- add support for new DAC ADAU1961
- increase main task stack size to prevent occasional stack overflows - remove bug in player component which sometimes lead to RESYNC 2 infinite loops
This commit is contained in:
@@ -43,39 +43,37 @@ extern audio_hal_func_t AUDIO_CODEC_MA120X0_DEFAULT_HANDLE;
|
||||
#elif CONFIG_DAC_MA120
|
||||
extern audio_hal_func_t AUDIO_CODEC_MA120_DEFAULT_HANDLE;
|
||||
#define AUDIO_CODEC_DEFAULT_HANDLE AUDIO_CODEC_MA120_DEFAULT_HANDLE
|
||||
#elif CONFIG_DAC_ADAU1961
|
||||
extern audio_hal_func_t AUDIO_CODEC_ADAU1961_DEFAULT_HANDLE;
|
||||
#define AUDIO_CODEC_DEFAULT_HANDLE AUDIO_CODEC_ADAU1961_DEFAULT_HANDLE
|
||||
#endif
|
||||
|
||||
static const char *TAG = "AUDIO_BOARD";
|
||||
|
||||
static audio_board_handle_t board_handle = 0;
|
||||
|
||||
audio_board_handle_t
|
||||
audio_board_init (void)
|
||||
{
|
||||
if (board_handle)
|
||||
{
|
||||
ESP_LOGW (TAG, "The board has already been initialized!");
|
||||
return board_handle;
|
||||
}
|
||||
board_handle = (audio_board_handle_t)audio_calloc (
|
||||
1, sizeof (struct audio_board_handle));
|
||||
AUDIO_MEM_CHECK (TAG, board_handle, return NULL);
|
||||
board_handle->audio_hal = audio_board_codec_init ();
|
||||
ESP_LOGI (TAG, "board-handle done");
|
||||
audio_board_handle_t audio_board_init(void) {
|
||||
if (board_handle) {
|
||||
ESP_LOGW(TAG, "The board has already been initialized!");
|
||||
return board_handle;
|
||||
}
|
||||
board_handle =
|
||||
(audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle));
|
||||
AUDIO_MEM_CHECK(TAG, board_handle, return NULL);
|
||||
board_handle->audio_hal = audio_board_codec_init();
|
||||
ESP_LOGI(TAG, "board-handle done");
|
||||
return board_handle;
|
||||
}
|
||||
|
||||
audio_hal_handle_t
|
||||
audio_board_codec_init (void)
|
||||
{
|
||||
ESP_LOGI ("HAL", "INIT");
|
||||
audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG ();
|
||||
audio_hal_handle_t audio_board_codec_init(void) {
|
||||
ESP_LOGI("HAL", "INIT");
|
||||
audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG();
|
||||
|
||||
audio_hal_handle_t codec_hal
|
||||
= audio_hal_init (&audio_codec_cfg, &AUDIO_CODEC_DEFAULT_HANDLE);
|
||||
ESP_LOGI ("HAL", "codec_hal done");
|
||||
audio_hal_handle_t codec_hal =
|
||||
audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_DEFAULT_HANDLE);
|
||||
ESP_LOGI("HAL", "codec_hal done");
|
||||
|
||||
AUDIO_NULL_CHECK (TAG, codec_hal, return NULL);
|
||||
AUDIO_NULL_CHECK(TAG, codec_hal, return NULL);
|
||||
return codec_hal;
|
||||
}
|
||||
|
||||
@@ -109,18 +107,12 @@ audio_board_codec_init (void)
|
||||
// return ret;
|
||||
//}
|
||||
|
||||
audio_board_handle_t
|
||||
audio_board_get_handle (void)
|
||||
{
|
||||
return board_handle;
|
||||
}
|
||||
audio_board_handle_t audio_board_get_handle(void) { return board_handle; }
|
||||
|
||||
esp_err_t
|
||||
audio_board_deinit (audio_board_handle_t audio_board)
|
||||
{
|
||||
esp_err_t audio_board_deinit(audio_board_handle_t audio_board) {
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret |= audio_hal_deinit (audio_board->audio_hal);
|
||||
free (audio_board);
|
||||
ret |= audio_hal_deinit(audio_board->audio_hal);
|
||||
free(audio_board);
|
||||
board_handle = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user