1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-08-18 10:22:31 +02: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
+10
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);
}
+2 -2
View File
@@ -2,6 +2,6 @@
#define _GWBUTTONTASK_H
#include "GwApi.h"
//task function
void handleButtons(GwApi *param);
DECLARE_USERTASK(handleButtons);
void initButtons(GwApi *param);
DECLARE_INITFUNCTION(initButtons);
#endif