From e5dbe3a96bf246d2a0a07559192bca7bd40c9f45 Mon Sep 17 00:00:00 2001 From: bbkiwi Date: Mon, 17 Jul 2017 01:20:25 +1200 Subject: [PATCH] Start ADC HPATimer only once. Makes for more stable collection of audio when connected to wifi (especially station mode). However the range of output from the ADC is truncated. TODO fix, or use system_adc_fast_read with wifi off and RF off The devfixes branch of esp82xx needs to be used --- embedded8266/esp82xx | 2 +- embedded8266/user/user_main.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/embedded8266/esp82xx b/embedded8266/esp82xx index 21e23b5..c0fc3a4 160000 --- a/embedded8266/esp82xx +++ b/embedded8266/esp82xx @@ -1 +1 @@ -Subproject commit 21e23b5c360045425abe6c855853f2d973420fc2 +Subproject commit c0fc3a450ce5c84ce77809d05d885d4ea304f833 diff --git a/embedded8266/user/user_main.c b/embedded8266/user/user_main.c index 5b5267b..0a2d696 100644 --- a/embedded8266/user/user_main.c +++ b/embedded8266/user/user_main.c @@ -131,6 +131,7 @@ static void ICACHE_FLASH_ATTR myTimer(void *arg) { StartHPATimer(); //Init the high speed ADC timer. hpa_running = 1; + hpa_is_paused_for_wifi = 0; // only need to do once prevents unstable ADC } // uart0_sendStr("."); // printf( "%d/%d\n",soundtail,soundhead ); @@ -222,6 +223,12 @@ void ICACHE_FLASH_ATTR user_init(void) ws2812_init(); + // Attempt to make ADC more stable + // https://github.com/esp8266/Arduino/issues/2070 + // see peripherals https://espressif.com/en/support/explore/faq + //wifi_set_sleep_type(NONE_SLEEP_T); // on its own stopped wifi working + //wifi_fpm_set_sleep_type(NONE_SLEEP_T); // with this seemed no difference + system_os_post(procTaskPrio, 0, 0 ); }