mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
* MyMesh::begin() refactor, removing last display concepts
This commit is contained in:
@@ -172,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());
|
||||
|
||||
Reference in New Issue
Block a user