Fixes and cleanup (#266)

- Fix issue with GT911 driver: fixed a crash and an init issue
- Cleanup of unused code
This commit is contained in:
Ken Van Hoeylandt
2025-03-31 15:59:50 +02:00
committed by GitHub
parent 3f1bfee3f5
commit eb4e9f9649
6 changed files with 24 additions and 68 deletions
@@ -844,7 +844,6 @@ static void dispatchDisconnectButKeepActive(std::shared_ptr<Wifi> wifi) {
static bool shouldScanForAutoConnect(std::shared_ptr<Wifi> wifi) {
auto lock = wifi->dataMutex.asScopedLock();
if (!lock.lock(100)) {
TT_LOG_W(TAG, "Auto-connect can't lock");
return false;
}
@@ -853,7 +852,6 @@ static bool shouldScanForAutoConnect(std::shared_ptr<Wifi> wifi) {
!wifi->pause_auto_connect;
if (!is_radio_in_scannable_state) {
TT_LOG_W(TAG, "Auto-connect: radio state not ok (%d, %d, %d)", (int)wifi->getRadioState(), wifi->isScanActive(), wifi->pause_auto_connect);
return false;
}
@@ -862,7 +860,6 @@ static bool shouldScanForAutoConnect(std::shared_ptr<Wifi> wifi) {
bool no_recent_scan = (current_time - wifi->last_scan_time) > (AUTO_SCAN_INTERVAL / portTICK_PERIOD_MS);
if (!scan_time_has_looped && !no_recent_scan) {
TT_LOG_W(TAG, "Auto-connect: scan time looped = %d, no recent scan = %d", scan_time_has_looped, no_recent_scan);
}
return scan_time_has_looped || no_recent_scan;