From 8a7fc32b68a41f4d33f4f886b7ea25bddd9057f5 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Mon, 3 Feb 2020 23:22:11 -0800 Subject: [PATCH] working A1S! --- components/services/monitor.c | 2 +- components/squeezelite/a1s/ac101.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/services/monitor.c b/components/services/monitor.c index 73a051b0..79906db4 100644 --- a/components/services/monitor.c +++ b/components/services/monitor.c @@ -90,7 +90,7 @@ bool spkfault_svc (void) { void monitor_svc_init(void) { ESP_LOGI(TAG, "Initializing monitoring"); -#ifdef JACK_GPIO +#if defined(JACK_GPIO) && JACK_GPIO != -1 gpio_pad_select_gpio(JACK_GPIO); gpio_set_direction(JACK_GPIO, GPIO_MODE_INPUT); diff --git a/components/squeezelite/a1s/ac101.c b/components/squeezelite/a1s/ac101.c index 671d3baf..414c2485 100644 --- a/components/squeezelite/a1s/ac101.c +++ b/components/squeezelite/a1s/ac101.c @@ -142,7 +142,7 @@ static bool init(int i2c_port_num, int i2s_num, i2s_config_t *i2s_config) { // configure I2S pins & install driver i2s_pin_config_t i2s_pin_config = (i2s_pin_config_t) { .bck_io_num = 27, .ws_io_num = 26, - .data_out_num = 35, .data_in_num = 25 //Not used + .data_out_num = 25, .data_in_num = 35 //Not used }; i2s_driver_install(i2s_num, i2s_config, 0, NULL); i2s_set_pin(i2s_num, &i2s_pin_config); @@ -170,18 +170,22 @@ static void volume(unsigned left, unsigned right) { * power */ static void power(adac_power_e mode) { + esp_err_t ret = ESP_OK; + switch(mode) { case ADAC_STANDBY: case ADAC_OFF: - ac101_stop(); + ret = ac101_stop(); break; case ADAC_ON: - ac101_start(AC_MODULE_ADC); + ret = ac101_start(AC_MODULE_DAC); break; default: ESP_LOGW(TAG, "unknown power command"); break; } + + if (ret != ESP_OK) ESP_LOGW(TAG, "can't start AC101 %d", ret); } /****************************************************************************************