mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 09:43:03 +00:00
Merge branch 'master' into eink
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -37,6 +37,8 @@
|
||||
#include "SPILock.h"
|
||||
#include "graphics/Screen.h"
|
||||
#include "main.h"
|
||||
#include "meshwifi/meshhttp.h"
|
||||
#include "meshwifi/meshwifi.h"
|
||||
#include "sleep.h"
|
||||
#include "target_specific.h"
|
||||
#include <OneButton.h>
|
||||
@@ -217,9 +219,9 @@ void setup()
|
||||
|
||||
// Currently only the tbeam has a PMU
|
||||
power = new Power();
|
||||
power->setup();
|
||||
power->setStatusHandler(powerStatus);
|
||||
powerStatus->observe(&power->newStatus);
|
||||
power->setup(); // Must be after status handler is installed, so that handler gets notified of the initial configuration
|
||||
|
||||
// Init our SPI controller (must be before screen and lora)
|
||||
initSPI();
|
||||
@@ -328,6 +330,9 @@ void setup()
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize Wifi
|
||||
initWifi();
|
||||
|
||||
if (!rIf)
|
||||
recordCriticalError(ErrNoRadio);
|
||||
else
|
||||
@@ -394,6 +399,8 @@ void loop()
|
||||
userButtonAlt.tick();
|
||||
#endif
|
||||
|
||||
loopWifi();
|
||||
|
||||
// Show boot screen for first 3 seconds, then switch to normal operation.
|
||||
static bool showingBootScreen = true;
|
||||
if (showingBootScreen && (millis() > 3000)) {
|
||||
@@ -420,5 +427,8 @@ void loop()
|
||||
// feel slow
|
||||
msecstosleep = 10;
|
||||
|
||||
// TODO: This should go into a thread handled by FreeRTOS.
|
||||
handleWebResponse();
|
||||
|
||||
delay(msecstosleep);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user