Remove auto-reboot and make timezone configurable
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -29,8 +29,6 @@ static char g_device_id[16] = "";
|
||||
static SenderStatus g_sender_statuses[NUM_SENDERS];
|
||||
static bool g_ap_mode = false;
|
||||
static WifiMqttConfig g_cfg;
|
||||
static uint32_t g_boot_ms = 0;
|
||||
static bool g_debug_forced_reboot_done = false;
|
||||
static FaultCounters g_sender_faults = {};
|
||||
static FaultCounters g_receiver_faults = {};
|
||||
static FaultCounters g_receiver_faults_published = {};
|
||||
@@ -121,7 +119,6 @@ static constexpr uint32_t METER_READER_TASK_STACK_WORDS = 4096;
|
||||
static constexpr UBaseType_t METER_READER_TASK_PRIORITY = 2;
|
||||
static constexpr BaseType_t METER_READER_TASK_CORE = 0;
|
||||
#endif
|
||||
static constexpr uint32_t DEBUG_FORCED_REBOOT_INTERVAL_MS = 3UL * 60UL * 60UL * 1000UL;
|
||||
|
||||
enum class TxBuildError : uint8_t {
|
||||
None = 0,
|
||||
@@ -937,7 +934,6 @@ void setup() {
|
||||
#endif
|
||||
|
||||
watchdog_init();
|
||||
g_boot_ms = millis();
|
||||
g_role = detect_role();
|
||||
init_device_ids(g_short_id, g_device_id, sizeof(g_device_id));
|
||||
display_set_role(g_role);
|
||||
@@ -1364,16 +1360,6 @@ receiver_loop_done:
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (SERIAL_DEBUG_MODE && !g_debug_forced_reboot_done &&
|
||||
(millis() - g_boot_ms >= DEBUG_FORCED_REBOOT_INTERVAL_MS)) {
|
||||
g_debug_forced_reboot_done = true;
|
||||
serial_debug_printf("debug: force reboot after %lu ms uptime",
|
||||
static_cast<unsigned long>(millis() - g_boot_ms));
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
delay(50);
|
||||
esp_restart();
|
||||
#endif
|
||||
}
|
||||
#ifdef ENABLE_TEST_MODE
|
||||
if (g_role == DeviceRole::Sender) {
|
||||
test_sender_loop(g_short_id, g_device_id);
|
||||
|
||||
Reference in New Issue
Block a user