1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 06:23:07 +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);
}

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