Merge pull request #3431 from meshcore-dev/abstract-ui-overhaul

Abstract UI overhaul
This commit is contained in:
ripplebiz
2026-09-20 18:08:29 +10:00
committed by GitHub
10 changed files with 310 additions and 213 deletions
+24 -26
View File
@@ -114,11 +114,7 @@ MultiSerialInterface interface_manager;
StdRNG fast_rng;
SimpleMeshTables tables;
MyMesh the_mesh(radio_driver, fast_rng, rtc_clock, tables, store
#ifdef DISPLAY_CLASS
, &ui_task
#endif
);
MyMesh the_mesh(radio_driver, fast_rng, rtc_clock, tables, store);
/* END GLOBAL OBJECTS */
@@ -176,37 +172,38 @@ void setup() {
#endif
#endif
store.begin();
the_mesh.begin(
#ifdef DISPLAY_CLASS
disp != NULL
#else
false
#endif
);
the_mesh.begin();
#elif defined(RP2040_PLATFORM)
LittleFS.begin();
store.begin();
the_mesh.begin(
#ifdef DISPLAY_CLASS
disp != NULL
#else
false
#endif
);
the_mesh.begin();
#elif defined(ESP32)
SPIFFS.begin(true);
store.begin();
the_mesh.begin(
#ifdef DISPLAY_CLASS
disp != NULL
#else
false
#endif
);
the_mesh.begin();
#else
#error "need to define filesystem"
#endif
#ifdef BLE_PIN_CODE // 123456 by default
if (the_mesh.getNodePrefs()->ble_pin == 0) {
#ifdef DISPLAY_CLASS
if (disp != NULL && BLE_PIN_CODE == 123456) {
StdRNG rng;
the_mesh.setBLEPin(rng.nextInt(100000, 999999)); // random pin each session
} else {
the_mesh.setBLEPin(BLE_PIN_CODE); // otherwise static pin
}
#else
the_mesh.setBLEPin(BLE_PIN_CODE); // otherwise static pin
#endif
} else {
the_mesh.setBLEPin(the_mesh.getNodePrefs()->ble_pin);
}
#else
the_mesh.setBLEPin(0);
#endif
// add bluetooth interface
#if defined(BLE_PIN_CODE)
bluetooth_interface.begin(BLE_NAME_PREFIX, the_mesh.getNodePrefs()->node_name, the_mesh.getBLEPin());
@@ -286,6 +283,7 @@ void setup() {
#ifdef DISPLAY_CLASS
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
the_mesh.setListener(&ui_task);
#endif
board.onBootComplete();