improved general structures to support HMS in future

This commit is contained in:
lumapu 2023-02-20 23:00:51 +01:00
parent c56c785a1f
commit c4dd372554
14 changed files with 96 additions and 77 deletions

View file

@ -1,12 +1,10 @@
//-----------------------------------------------------------------------------
// 2022 Ahoy, https://www.mikrocontroller.net/topic/525778
// 2023 Ahoy, https://www.mikrocontroller.net/topic/525778
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//-----------------------------------------------------------------------------
#include "utils/dbg.h"
#include "app.h"
#include "config/config.h"
app myApp;
@ -20,13 +18,14 @@ IRAM_ATTR void handleHmsIntr(void) {
myApp.handleHmsIntr();
}
//-----------------------------------------------------------------------------
void setup() {
myApp.setup();
attachInterrupt(digitalPinToInterrupt(myApp.getIrqPin()), handleIntr, FALLING);
attachInterrupt(digitalPinToInterrupt(myApp.getHmsIrqPin()), handleHmsIntr, RISING);
if(myApp.getNrfEnabled())
attachInterrupt(digitalPinToInterrupt(myApp.getNrfIrqPin()), handleIntr, FALLING);
if(myApp.getCmtEnabled())
attachInterrupt(digitalPinToInterrupt(myApp.getCmtIrqPin()), handleHmsIntr, RISING);
}