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:
@@ -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,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
|
||||
Reference in New Issue
Block a user