ready for testing
This commit is contained in:
parent
03728205d7
commit
14654b4d32
|
|
@ -55,7 +55,7 @@ TinyGPSPlus gps;
|
|||
BluetoothSerial SerialBT;
|
||||
#endif
|
||||
|
||||
String versionDate = "2024.11.13";
|
||||
String versionDate = "2024.11.14";
|
||||
|
||||
uint8_t myBeaconsIndex = 0;
|
||||
int myBeaconsSize = Config.beacons.size();
|
||||
|
|
@ -186,6 +186,9 @@ void loop() {
|
|||
Utils::checkDisplayEcoMode();
|
||||
|
||||
KEYBOARD_Utils::read();
|
||||
#ifdef HAS_JOYSTICK
|
||||
JOYSTICK_Utils::loop();
|
||||
#endif
|
||||
|
||||
ReceivedLoRaPacket packet = LoRa_Utils::receivePacket();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
namespace BUTTON_Utils {
|
||||
|
||||
void longPress();
|
||||
|
||||
void loop();
|
||||
void setup();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
#include "joystick_utils.h"
|
||||
#include "keyboard_utils.h"
|
||||
#include "boards_pinout.h"
|
||||
#include "button_utils.h"
|
||||
|
||||
extern int menuDisplay;
|
||||
extern int menuDisplay;
|
||||
|
||||
bool exitJoystickInterrupt = false;
|
||||
|
||||
typedef void (*DirectionFunc)();
|
||||
|
||||
#ifdef HAS_JOYSTICK
|
||||
|
||||
namespace JOYSTICK_Utils {
|
||||
|
||||
int debounceDelay = 300;
|
||||
int debounceDelay = 400;
|
||||
uint32_t lastInterruptTime = 0;
|
||||
|
||||
bool checkLastJoystickInterrupTime() {
|
||||
|
|
@ -20,14 +25,33 @@ extern int menuDisplay;
|
|||
}
|
||||
}
|
||||
|
||||
void IRAM_ATTR joystickHandler(void (*directionFunc)()) {
|
||||
if (checkLastJoystickInterrupTime() && menuDisplay != 0) directionFunc();
|
||||
bool checkMenuDisplayToExitInterrupt(int menu) {
|
||||
if (menu == 10 || menu == 120 || menu == 200 || menu == 210 || menu == 51 || menu == 50100 || menu == 50111) {
|
||||
return true; // read / delete/ callsignIndex / loraIndex / readW / readW / delete
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void loop() { // for running process with SPIFFS outside interrupt
|
||||
if (checkMenuDisplayToExitInterrupt(menuDisplay) && exitJoystickInterrupt) BUTTON_Utils::longPress();
|
||||
}
|
||||
|
||||
void IRAM_ATTR joystickHandler(DirectionFunc directionFunc) {
|
||||
if (checkLastJoystickInterrupTime() && menuDisplay != 0) {
|
||||
if (checkMenuDisplayToExitInterrupt(menuDisplay) && directionFunc == BUTTON_Utils::longPress) {
|
||||
exitJoystickInterrupt = true;
|
||||
} else {
|
||||
exitJoystickInterrupt = false;
|
||||
directionFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IRAM_ATTR joystickUp() { joystickHandler(KEYBOARD_Utils::upArrow); }
|
||||
void IRAM_ATTR joystickDown() { joystickHandler(KEYBOARD_Utils::downArrow); }
|
||||
void IRAM_ATTR joystickLeft() { joystickHandler(KEYBOARD_Utils::leftArrow); }
|
||||
void IRAM_ATTR joystickRight() { joystickHandler(KEYBOARD_Utils::rightArrow); }
|
||||
void IRAM_ATTR joystickRight() { joystickHandler(BUTTON_Utils::longPress); }
|
||||
|
||||
void setup() {
|
||||
pinMode(JOYSTICK_CENTER, INPUT_PULLUP);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
namespace JOYSTICK_Utils {
|
||||
|
||||
void loop();
|
||||
void setup();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,7 +283,11 @@ namespace KEYBOARD_Utils {
|
|||
} else if (menuDisplay == 10) {
|
||||
MSG_Utils::loadMessagesFromMemory(0);
|
||||
if (MSG_Utils::warnNoAPRSMessages()) {
|
||||
menuDisplay = 10;
|
||||
#ifdef HAS_JOYSTICK
|
||||
menuDisplay = 11;
|
||||
#else
|
||||
menuDisplay = 10;
|
||||
#endif
|
||||
} else {
|
||||
menuDisplay = 100;
|
||||
}
|
||||
|
|
@ -355,7 +359,11 @@ namespace KEYBOARD_Utils {
|
|||
} else if (menuDisplay == 51) {
|
||||
MSG_Utils::loadMessagesFromMemory(1);
|
||||
if (MSG_Utils::warnNoWLNKMails()) {
|
||||
menuDisplay = 51;
|
||||
#ifdef HAS_JOYSTICK
|
||||
menuDisplay = 50;
|
||||
#else
|
||||
menuDisplay = 51;
|
||||
#endif
|
||||
} else {
|
||||
menuDisplay = 50101;
|
||||
}
|
||||
|
|
@ -387,7 +395,11 @@ namespace KEYBOARD_Utils {
|
|||
displayShow("___INFO___", "", " ALL MAILS DELETED!", 2000);
|
||||
MSG_Utils::loadNumMessages();
|
||||
if (winlinkStatus == 0) {
|
||||
menuDisplay = 52;
|
||||
#ifdef HAS_JOYSTICK
|
||||
menuDisplay = 50;
|
||||
#else
|
||||
menuDisplay = 52;
|
||||
#endif
|
||||
} else {
|
||||
menuDisplay = 50110;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,8 +166,8 @@ namespace MSG_Utils {
|
|||
loadedWLNKMails.push_back(fileToRead.readStringUntil('\n'));
|
||||
}
|
||||
fileToRead.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ledNotification() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue