diff --git a/platformio.ini b/platformio.ini index c8e118cb9..bac0a6178 100644 --- a/platformio.ini +++ b/platformio.ini @@ -55,7 +55,7 @@ build_flags = -DWIDTH=240 -DHEIGHT=135 -DBACKLIGHT=27 - -DMINBRIGHT=190 + -DMINBRIGHT=80 -DLED=19 -DLED_ON=HIGH @@ -174,7 +174,7 @@ build_flags = -DWIDTH=240 -DHEIGHT=135 -DBACKLIGHT=38 - -DMINBRIGHT=165 + -DMINBRIGHT=80 -DMAX_MENU_SIZE=5 -DFP=1 @@ -287,7 +287,7 @@ build_flags = -DLED_ON=HIGH -DLED_OFF=LOW -DBACKLIGHT=38 - -DMINBRIGHT=165 + -DMINBRIGHT=80 -DMAX_MENU_SIZE=5 -DUSER_SETUP_LOADED=1 -DST7789_2_DRIVER=1 diff --git a/src/TV-B-Gone.cpp b/src/TV-B-Gone.cpp index cb1f98b33..f19973d07 100644 --- a/src/TV-B-Gone.cpp +++ b/src/TV-B-Gone.cpp @@ -128,14 +128,10 @@ void sendAllCodes() displayRedStripe("Paused", TFT_WHITE, BGCOLOR); while (!checkSelPress()){ // Se apertar Select denovo, continua - #ifndef CARDPUTER - if(checkPrevPress()) { // Cancela o TV-B-Gone - endingEarly = true; - break; + if(checkEscPress()) { + endingEarly= true; + break; } - #else - if(Keyboard.isKeyPressed('`')) break;; // apertar ESC no Cardputer // Cancela o TV-B-Gone - #endif } while (checkSelPress()){ yield(); diff --git a/src/ble_spam.cpp b/src/ble_spam.cpp index fa33b0335..55888f644 100644 --- a/src/ble_spam.cpp +++ b/src/ble_spam.cpp @@ -467,9 +467,7 @@ void executeSourApple() { NimBLEServer *pServer = NimBLEDevice::createServer(); pAdvertising = pServer->getAdvertising(); - esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); - esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN ,ESP_PWR_LVL_P9); delay(40); //NimBLEAdvertisementData advertisementData = getOAdvertisementData(); NimBLEAdvertisementData advertisementData = GetUniversalAdvertisementData(Apple); @@ -487,10 +485,7 @@ void executeSwiftpairSpam(EBLEPayloadType type) { NimBLEDevice::init(""); NimBLEServer *pServer = NimBLEDevice::createServer(); - esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_DEFAULT, ESP_PWR_LVL_P9); esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_ADV, ESP_PWR_LVL_P9); - esp_ble_tx_power_set(ESP_BLE_PWR_TYPE_SCAN ,ESP_PWR_LVL_P9); - pAdvertising = pServer->getAdvertising(); //NimBLEAdvertisementData advertisementData = getSwiftAdvertisementData(); diff --git a/src/display.cpp b/src/display.cpp index 2e4971530..6bb9775bd 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -167,8 +167,7 @@ void loopOptions(const std::vector> } #ifdef CARDPUTER - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) break; + if(checkEscPress()) break; #endif } delay(200); diff --git a/src/main.cpp b/src/main.cpp index 37228c96d..4d6616d92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,11 +100,25 @@ void setup() { #endif getBrightness(); - sprite.createSprite(WIDTH-15,HEIGHT-15); //Start Bootscreen timer int i = millis(); - while(millis()2000) && (millis()-i)<2500) tft.fillScreen(TFT_BLACK); + if((millis()-i>2500) && (millis()-i)<2700) sprite.pushSprite(0,0); + if((millis()-i>2700) && (millis()-i)<2900) tft.fillScreen(TFT_BLACK); + if((millis()-i>3100) && (millis()-i)<3300) sprite.pushSprite(0,0); + if((millis()-i>3300) && (millis()-i)<3700) tft.fillScreen(TFT_BLACK); + if((millis()-i>3700)) menu_op.pushSprite(0,0); + #if defined (CARDPUTER) // If any key is pressed, it'll jump the boot screen Keyboard.update(); @@ -121,6 +135,10 @@ void setup() { // If M5 or Enter button is pressed, continue from here Program: + sprite.deleteSprite(); + menu_op.deleteSprite(); + sprite.createSprite(WIDTH-15,HEIGHT-15); + getBrightness(); delay(200); } @@ -171,7 +189,7 @@ void loop() { }; } else { options = { - {"Disconnect Wifi", [=]() { wifiDisconnect(); }}, //wifi_common.h + {"Disconnect", [=]() { wifiDisconnect(); }}, //wifi_common.h }; } options.push_back({"Wifi Atks", [=]() { wifi_atk_menu(); }}); @@ -181,11 +199,10 @@ void loop() { options.push_back({"DPWO-ESP32", [=]() { dpwo_setup(); }}); options.push_back({"Evil Portal", [=]() { startEvilPortal(); }}); options.push_back({"ARP Scan", [=]() { local_scan_setup(); }}); - options.push_back({"Wireguard Tun", [=]() { wg_setup(); }}); + options.push_back({"Wireguard", [=]() { wg_setup(); }}); options.push_back({"Main Menu", [=]() { backToMenu(); }}); delay(200); loopOptions(options,false,true,"WiFi"); - // delay(1000); // remover depois, está aqui só por causa do "displayRedStripe" break; case 1: // BLE options = { @@ -199,7 +216,6 @@ void loop() { }; delay(200); loopOptions(options,false,true,"Bluetooth"); - delay(1000); // remover depois, está aqui só por causa do "displayRedStripe" break; case 2: // RF options = { @@ -215,35 +231,33 @@ void loop() { case 3: // RFID options = { {"Scan/copy", [=]() { rfid_setup(); }}, //@IncursioHack - {"Replay", [=]() { displayRedStripe("Replay"); }}, + //{"Replay", [=]() { displayRedStripe("Replay"); }}, {"Main Menu", [=]() { backToMenu(); }}, }; delay(200); loopOptions(options,false,true,"RFID"); - //delay(1000); // remover depois, está aqui só por causa do "displayRedStripe" break; case 4: //Other options = { - {"TV-B-Gone", [=]() { StartTvBGone(); }}, - {"SD Card", [=]() { loopSD(); }}, - {"WebUI", [=]() { loopOptionsWebUi(); }}, + {"TV-B-Gone", [=]() { StartTvBGone(); }}, + {"SD Card", [=]() { loopSD(); }}, + {"WebUI", [=]() { loopOptionsWebUi(); }}, {"Megalodon", [=]() { shark_setup(); }}, }; if(sdcardMounted) options.push_back({"Custom IR", [=]() { otherIRcodes(); }}); #ifdef CARDPUTER - options.push_back({"BadUSB", [=]() { usb_setup(); }}); - options.push_back({"LED Control", [=]() { ledrgb_setup(); }}); //IncursioHack - options.push_back({"LED FLash", [=]() { ledrgb_flash(); }}); // IncursioHack + options.push_back({"BadUSB", [=]() { usb_setup(); }}); + options.push_back({"LED Control", [=]() { ledrgb_setup(); }}); //IncursioHack + options.push_back({"LED FLash", [=]() { ledrgb_flash(); }}); // IncursioHack #endif - options.push_back({"Openhaystack", [=]() { openhaystack_setup(); }}); + options.push_back({"Openhaystack", [=]() { openhaystack_setup(); }}); options.push_back({"Main Menu", [=]() { backToMenu(); }}); delay(200); loopOptions(options,false,true,"Others"); - delay(1000); // remover depois, está aqui só por causa do "displayRedStripe" break; case 5: //Config options = { - {"Brightness", [=]() { setBrightnessMenu(); }}, //settings.h + {"Brightness", [=]() { setBrightnessMenu(); }}, //settings.h {"Orientation", [=]() { gsetRotation(true); }}, //settings.h {"Main Menu", [=]() { backToMenu(); }}, {"Restart", [=]() { ESP.restart(); }}, @@ -257,3 +271,4 @@ void loop() { } } } + diff --git a/src/mykeyboard.cpp b/src/mykeyboard.cpp index 04757aaa2..14a05dd26 100644 --- a/src/mykeyboard.cpp +++ b/src/mykeyboard.cpp @@ -52,13 +52,11 @@ bool checkEscPress(){ Keyboard.update(); if(Keyboard.isKeyPressed('`')) #endif - { + { returnToMenu=true; - - return true; -} -else { return false; } + } + else { return false; } } #ifndef STICK_C diff --git a/src/rfid.cpp b/src/rfid.cpp index e89d063ec..a37f350c3 100644 --- a/src/rfid.cpp +++ b/src/rfid.cpp @@ -100,18 +100,10 @@ void rfid_loop() { } } // Checks para sair do while - #ifndef CARDPUTER - if(checkPrevPress()) { // Apertar o botão power dos sticks + if(checkEscPress()) { tft.fillScreen(BGCOLOR); goto Exit; } - #else - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) { - tft.fillScreen(BGCOLOR); - goto Exit; - } // apertar ESC no Cardputer - #endif } Exit: diff --git a/src/sd_functions.cpp b/src/sd_functions.cpp index 306a17899..d12c91c18 100644 --- a/src/sd_functions.cpp +++ b/src/sd_functions.cpp @@ -464,8 +464,7 @@ String loopSD(bool filePicker) { } #ifdef CARDPUTER - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) break; + if(checkEscPress()) break; #endif } return result; diff --git a/src/tururururu.cpp b/src/tururururu.cpp index b690e7388..13b818dfb 100644 --- a/src/tururururu.cpp +++ b/src/tururururu.cpp @@ -172,18 +172,10 @@ void shark_loop() { score++; } - #ifndef CARDPUTER - if(checkPrevPress()) { // Apertar o botão power dos sticks - returnToMenu=true; - goto Exit; + if(checkEscPress()) { + returnToMenu=true; + goto Exit; } - #else - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) { - returnToMenu=true; - goto Exit; - } // apertar ESC no Cardputer - #endif } Exit: diff --git a/src/wifi_atks.cpp b/src/wifi_atks.cpp index 508db4684..46464f824 100644 --- a/src/wifi_atks.cpp +++ b/src/wifi_atks.cpp @@ -204,23 +204,14 @@ void target_atk(String tssid,String mac, uint8_t channel) { while(checkSelPress()) { delay(50); } // timeless debounce // wait to restart or kick out of the function while(!checkSelPress()) { - #ifndef CARDPUTER - if(checkPrevPress()) break; // Apertar o botão power dos sticks - #else - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) break; // Apertar o ESC do cardputer - #endif + if(checkEscPress()) break; } while(checkSelPress()) { delay(50); } // timeless debounce redraw=true; } // Checks para sair do while - #ifndef CARDPUTER - if(checkPrevPress()) break; // Apertar o botão power dos sticks - #else - Keyboard.update(); - if(Keyboard.isKeyPressed('`')) break; // Apertar o ESC do cardputer - #endif + if(checkEscPress()) break; + } wifiDisconnect(); returnToMenu=true;