Refactored MyMesh, advert on doublepress

Pulled the class out of main.cpp, made a header to go along with it, externed globals in headers to make them accessible to button code. Added button code to send an advert on double press. Refactored ini files to prevent linker errors.
This commit is contained in:
hank 2025-05-29 13:06:24 -07:00
parent 3d6c42978c
commit f58a34f5f4
10 changed files with 2135 additions and 1586 deletions

View file

@ -2,6 +2,7 @@
#include <Arduino.h>
#include <helpers/TxtDataHelpers.h>
#include "NodePrefs.h"
#include "MyMesh.h"
#define AUTO_OFF_MILLIS 15000 // 15 seconds
#define BOOT_SCREEN_MILLIS 4000 // 4 seconds
@ -340,8 +341,14 @@ void UITask::handleButtonShortPress() {
}
void UITask::handleButtonDoublePress() {
MESH_DEBUG_PRINTLN("UITask: double press triggered");
// Not implemented. TODO: possibly send an advert here?
MESH_DEBUG_PRINTLN("UITask: double press triggered, sending advert");
// ADVERT
if(the_mesh.advert()) {
MESH_DEBUG_PRINTLN("Advert sent!");
}
else {
MESH_DEBUG_PRINTLN("Advert failed!");
}
}
void UITask::handleButtonTriplePress() {