From 0d6b398e6dbb6c7a9150ae6c3f02a237d4ac3437 Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Sun, 30 Jan 2022 17:09:08 +0100 Subject: [PATCH] changes --- lib/obp60task/GwOBP60Task.cpp | 5 ++++- lib/obp60task/config.json | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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",