Fix for SoftAP bugs

This commit is contained in:
Jm Casler
2021-12-23 18:18:07 -08:00
parent a192da5cd0
commit 2d8bf4d684
7 changed files with 52 additions and 87 deletions

View File

@@ -14,6 +14,7 @@
#include "rom/rtc.h"
#include <driver/rtc_io.h>
#include <driver/uart.h>
#include "mesh/http/WiFiAPClient.h"
#include "nimble/BluetoothUtil.h"
@@ -48,6 +49,22 @@ RTC_DATA_ATTR int bootCount = 0;
void setCPUFast(bool on)
{
#ifndef NO_ESP32
if (isWifiAvailable()) {
/*
*
* There's a newly introduced bug in the espressif framework where WiFi is
* unstable when the frequency is less than 240mhz.
*
* This mostly impacts WiFi AP mode but we'll bump the frequency for
* all WiFi use cases.
* (Added: Dec 23, 2021 by Jm Casler)
*/
DEBUG_MSG("Setting CPU to 240mhz because WiFi is in use.\n");
setCpuFrequencyMhz(240);
return;
}
setCpuFrequencyMhz(on ? 240 : 80);
#endif
}