<SOLVED> IDF esp_wifi_stop() interfering with LEDC operation
Posted: Mon Jan 30, 2023 4:03 am
Hi, I've got a weird problem whereby when I turn wifi off (not that this is off not on) my leds under control of ledc start flickering. When I re-enable wifi they go back to normal. I suspect this is something to do with the wifi turn off code doing something to the clock supplying the ledc module but I really have no clue. My wifi stop code is below. Some of if it non-idf obviously.
Does anyone have any ideas as to where to start looking?
Does anyone have any ideas as to where to start looking?
Code: Select all
void wifi_stop()
{
telemetry_notify_wifi_disconnected();
webserver_stop();
AP_state = AP_STATE_Off;
STA_state = STA_STATE_Idle;
deinit_mini_dns();
esp_netif_deinit();
esp_wifi_stop();
if (reconnect_timer)
{
xTimerStop(reconnect_timer, (TickType_t)1000 / portTICK_PERIOD_MS);
xTimerReset(reconnect_timer, 1);
}
if (ap_stop_timer)
{
xTimerStop(ap_stop_timer, (TickType_t)1000 / portTICK_PERIOD_MS);
xTimerReset(ap_stop_timer, 1);
}
wifi_state = WIFI_STATE_STOPPED;
led_change_pattern(LED_WIFI_OFF, true);
}