Merge pull request #947 from justcallmekoko/develop

Slow down dual band channel hopping
This commit is contained in:
Just Call Me Koko
2025-10-17 11:18:05 -04:00
committed by GitHub
5 changed files with 42 additions and 69 deletions

View File

@@ -109,6 +109,39 @@ bool Display::isTouchHeld(uint16_t threshold) {
return false;
}
void Display::setCalData(bool landscape) {
#ifndef HAS_CYD_TOUCH
if (!landscape) {
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 239, 3560, 262, 3643, 4 };
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 298, 3451, 377, 3509, 4 };
#elif defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
#endif
#ifdef HAS_ILI9341
tft.setTouch(calData);
#endif
}
else {
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 272, 3648, 234, 3565, 7 };
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 382, 3492, 293, 3502, 7 };
#else if defined(TFT_DIY)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
#endif
#ifdef HAS_ILI9341
tft.setTouch(calData);
#endif
}
#endif
}
// Function to prepare the display and the menus
void Display::RunSetup()
{
@@ -136,16 +169,7 @@ void Display::RunSetup()
#ifdef HAS_ILI9341
#ifndef HAS_CYD_TOUCH
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 239, 3560, 262, 3643, 4 };
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 286, 3495, 437, 3449, 6 };
#elif defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
#endif
tft.setTouch(calData);
this->setCalData();
#endif
#endif

View File

@@ -149,6 +149,7 @@ class Display
void touchToExit();
void twoPartDisplay(String center_text);
void updateBanner(String msg);
void setCalData(bool landscape = false);
};
#endif
#endif

View File

@@ -1519,6 +1519,8 @@ void MenuFunctions::updateStatusBar()
wifi_scan_obj.old_channel = current_channel;
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER) || defined(MARAUDER_CARDPUTER)
display_obj.tft.fillRect(TFT_WIDTH/4, 0, CHAR_WIDTH * 6, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#elif defined(HAS_DUAL_BAND)
display_obj.tft.fillRect(50, 0, (CHAR_WIDTH / 2) * 8, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#else
display_obj.tft.fillRect(50, 0, (CHAR_WIDTH / 2) * 7, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#endif
@@ -1856,17 +1858,7 @@ void MenuFunctions::orientDisplay()
#ifdef HAS_ILI9341
#ifndef HAS_CYD_TOUCH
#ifdef TFT_SHIELD
uint16_t calData[5] = { 275, 3494, 361, 3528, 4 }; // tft.setRotation(0); // Portrait with TFT Shield
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 239, 3560, 262, 3643, 4 };
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 286, 3495, 437, 3449, 6 };
#else if defined(TFT_DIY)
uint16_t calData[5] = { 339, 3470, 237, 3438, 2 }; // tft.setRotation(0); // Portrait with DIY TFT
#endif
display_obj.tft.setTouch(calData);
display_obj.setCalData();
#else
display_obj.touchscreen.setRotation(0);
#endif

View File

@@ -2214,21 +2214,7 @@ void WiFiScan::RunAPScan(uint8_t scan_mode, uint16_t color)
#endif
#ifndef HAS_CYD_TOUCH
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
Serial.println("Using TFT Shield");
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 272, 3648, 234, 3565, 7 };
Serial.println("Using CYD 3.5inch (join wifi)");
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 362, 3489, 260, 3486, 7 };
#else if defined(TFT_DIY)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
Serial.println("Using TFT DIY (join wifi)");
#endif
#ifdef HAS_ILI9341
display_obj.tft.setTouch(calData);
#endif
display_obj.setCalData(true);
#else
//display_obj.touchscreen.setRotation(1);
#endif
@@ -2831,19 +2817,7 @@ void WiFiScan::RunPacketMonitor(uint8_t scan_mode, uint16_t color)
#ifdef HAS_SCREEN
#ifndef HAS_CYD_TOUCH
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
Serial.println("Using TFT Shield");
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 272, 3648, 234, 3565, 7 }; // Landscape
Serial.println("Using CYD 3.5inch");
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 362, 3489, 260, 3486, 7 };
#else if defined(TFT_DIY)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
Serial.println("Using TFT DIY");
#endif
display_obj.tft.setTouch(calData);
display_obj.setCalData(true);
#else
//display_obj.touchscreen.setRotation(1);
#endif
@@ -2962,18 +2936,7 @@ void WiFiScan::RunEapolScan(uint8_t scan_mode, uint16_t color)
#ifdef HAS_SCREEN
#ifndef HAS_CYD_TOUCH
#ifdef TFT_SHIELD
uint16_t calData[5] = { 391, 3491, 266, 3505, 7 }; // Landscape TFT Shield
//Serial.println("Using TFT Shield");
#elif defined(MARAUDER_CYD_3_5_INCH)
uint16_t calData[5] = { 272, 3648, 234, 3565, 7 };
#elif defined(MARAUDER_V8)
uint16_t calData[5] = { 362, 3489, 260, 3486, 7 };
#else if defined(TFT_DIY)
uint16_t calData[5] = { 213, 3469, 320, 3446, 1 }; // Landscape TFT DIY
//Serial.println("Using TFT DIY");
#endif
display_obj.tft.setTouch(calData);
display_obj.setCalData(true);
#else
//display_obj.touchscreen.setRotation(1);
#endif
@@ -8643,13 +8606,6 @@ void WiFiScan::main(uint32_t currentTime)
else if ((currentScanMode == WIFI_SCAN_CHAN_ANALYZER) ||
(currentScanMode == BT_SCAN_ANALYZER)) {
this->channelAnalyzerLoop(currentTime);
#ifdef HAS_ILI9341
if (currentTime - initTime >= this->channel_hop_delay * 1000)
{
initTime = millis();
channelHop();
}
#endif
}
else if ((currentScanMode == WIFI_SCAN_PACKET_RATE) ||
(currentScanMode == WIFI_SCAN_RAW_CAPTURE)) {

View File

@@ -2549,6 +2549,6 @@
#ifndef HAS_DUAL_BAND
#define HOP_DELAY 1000
#else
#define HOP_DELAY 100
#define HOP_DELAY 250
#endif
#endif