diff --git a/lib/obp60task/GwOBP60Task.cpp b/lib/obp60task/GwOBP60Task.cpp index 8173c1e..7a9d154 100644 --- a/lib/obp60task/GwOBP60Task.cpp +++ b/lib/obp60task/GwOBP60Task.cpp @@ -119,7 +119,10 @@ void OBP60Init(GwApi *api){ GwLog *logger=api->getLogger(); // Define timer interrupts - Timer1.attach_ms(1, underVoltageDetection); // Maximum speed with 1ms + bool uvoltage = api->getConfig()->getConfigItem(api->getConfig()->underVoltage,true)->asBoolean(); + if(uvoltage == true){ + Timer1.attach_ms(1, underVoltageDetection); // Maximum speed with 1ms + } Timer2.attach_ms(40, readKeypad); // Timer value nust grater than 30ms Timer3.attach_ms(500, blinkingFlashLED); diff --git a/lib/obp60task/config.json b/lib/obp60task/config.json index deb87d6..0a936b4 100644 --- a/lib/obp60task/config.json +++ b/lib/obp60task/config.json @@ -285,6 +285,17 @@ "obp60":"true" } }, + { + "name": "underVoltage", + "label": "Undervoltage", + "type": "boolean", + "default": "false", + "description": "If undervoltage detection [on|off] lower than 9V then switch off the device", + "category": "OBP60 Hardware", + "capabilities": { + "obp60":"true" + } + }, { "name": "useSimuData", "label": "Simulation Data",