1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-17 07:43:06 +01:00

added claiming for task interface

This commit is contained in:
andreas
2023-10-27 20:54:39 +02:00
parent a6c1511298
commit c03e54601c
4 changed files with 44 additions and 6 deletions

View File

@@ -110,4 +110,14 @@ void handleButtons(GwApi *api){
}
vTaskDelete(NULL);
#endif
}
void initButtons(GwApi *api){
#ifndef GWBUTTON_PIN
api->getLogger()->logDebug(GwLog::LOG,"no buttons defined, no button task");
return;
#endif
const String taskname("buttonTask");
api->addUserTask(handleButtons,taskname);
api->taskInterfaces()->claim<IButtonTask>(taskname);
}