From c2815a2d001d98c72f69913c9596cd5c9ff89c97 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Fri, 30 Jul 2021 03:30:07 +0300 Subject: [PATCH] config reload fix (caused by timer) --- lighthub/main.cpp | 68 ++++++++++++++++++++++++++--------------------- lighthub/main.h | 2 +- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index e0188df..ed85ab2 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -23,6 +23,10 @@ e-mail anklimov@gmail.com #include "flashstream.h" #include "config.h" +#if defined(__SAM3X8E__) +#include "TimerInterrupt_Generic.h" +#endif + #if defined(FS_STORAGE) flashStream sysConfStream("config.bin"); flashStream JSONStream("config.json"); @@ -212,7 +216,7 @@ debugSerial<next; } -#if defined(__SAM3X8E__) -// Interval in microsecs -attachTimer(TIMER_INTERVAL_MS * 1000, TimerHandler, "ITimer"); -#endif + // Interval in microsecs + attachTimer(TIMER_INTERVAL_MS * 1000, TimerHandler, "ITimer"); + #endif configLocked--; } @@ -2260,9 +2268,9 @@ void thermoLoop(void) { publishStat(); #ifndef DISABLE_FREERAM_PRINT (thermostatCheckPrinted) ? debugSerial< #include #include -#include "TimerInterrupt_Generic.h" +//#include "TimerInterrupt_Generic.h" #endif #if defined(ARDUINO_ARCH_AVR)