diff --git a/build-flags/build_flags_due b/build-flags/build_flags_due index e06c4cf..a45c7e9 100644 --- a/build-flags/build_flags_due +++ b/build-flags/build_flags_due @@ -11,4 +11,5 @@ -DMDNS_ENABLE -DMCP23017 -DCORS=\"http://lazyhome.ru\" +-DTIMER_INT diff --git a/build-flags/build_flags_due-5100 b/build-flags/build_flags_due-5100 index e94cde9..3457cb4 100644 --- a/build-flags/build_flags_due-5100 +++ b/build-flags/build_flags_due-5100 @@ -6,3 +6,4 @@ #-DPID_DISABLE -DARDUINO_OTA_MDNS_DISABLE -DMDNS_ENABLE +-DTIMER_INT diff --git a/build-flags/build_flags_due-5500 b/build-flags/build_flags_due-5500 index 6be5c9e..b3872a3 100644 --- a/build-flags/build_flags_due-5500 +++ b/build-flags/build_flags_due-5500 @@ -6,3 +6,4 @@ #-DPID_DISABLE -DARDUINO_OTA_MDNS_DISABLE -DMDNS_ENABLE +-DTIMER_INT diff --git a/build-flags/build_flags_lighthub21 b/build-flags/build_flags_lighthub21 index 1911320..67df496 100644 --- a/build-flags/build_flags_lighthub21 +++ b/build-flags/build_flags_lighthub21 @@ -11,3 +11,4 @@ #-DPID_DISABLE -DARDUINO_OTA_MDNS_DISABLE -DMDNS_ENABLE +-DTIMER_INT diff --git a/compiled/lighthub21/firmware.bin b/compiled/lighthub21/firmware.bin index 5c0d3ad..7f8b42d 100644 Binary files a/compiled/lighthub21/firmware.bin and b/compiled/lighthub21/firmware.bin differ diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index 798ad75..6b23df5 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -797,7 +797,8 @@ if (cause != CHECK_INTERRUPT) switch (store->state) //Timer based transitions if ( //No future !aJson.getObjectItem(inputObj, "scmd2") && !aJson.getObjectItem(inputObj, "lcmd2") && - !aJson.getObjectItem(inputObj, "rpcmd2") + !aJson.getObjectItem(inputObj, "rpcmd2") && + !aJson.getObjectItem(inputObj, "dclick") ) res = changeState(IS_PRESSED, cause); @@ -829,7 +830,8 @@ if (cause != CHECK_INTERRUPT) switch (store->state) //Timer based transitions if ( //No future !aJson.getObjectItem(inputObj, "scmd2") && !aJson.getObjectItem(inputObj, "lcmd2") && - !aJson.getObjectItem(inputObj, "rpcmd2") + !aJson.getObjectItem(inputObj, "rpcmd2") && + !aJson.getObjectItem(inputObj, "dclick") ) res = changeState(IS_IDLE, cause); else res = changeState(IS_RELEASED2, cause); break; diff --git a/lighthub/main.cpp b/lighthub/main.cpp index 1744ec4..579e684 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -1622,7 +1622,7 @@ void TimerHandler(void) } -#if defined(__SAM3X8E__) +#if defined(__SAM3X8E__) && defined (TIMER_INT) int16_t attachTimer(double microseconds, timerCallback callback, const char* TimerName) { if (timerNumber!=-1) return timerNumber; @@ -1726,8 +1726,7 @@ void setup_main() { infoSerial<next; } + #if defined(__SAM3X8E__) && defined (TIMER_INT) // Interval in microsecs attachTimer(TIMER_CHECK_INPUT * 1000, TimerHandler, "ITimer"); #endif