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

avoid the need for additional includes for task interfaces

This commit is contained in:
andreas
2023-10-28 11:04:40 +02:00
parent ff1bc50607
commit a98693a9b1
9 changed files with 29 additions and 43 deletions

View File

@@ -1,5 +1,4 @@
#include "GwButtonTask.h"
#include "GwIButtonTask.h"
#include "GwHardware.h"
#include "GwApi.h"
#include "GwLedTask.h"

View File

@@ -4,4 +4,19 @@
//task function
void initButtons(GwApi *param);
DECLARE_INITFUNCTION(initButtons);
class IButtonTask : public GwApi::TaskInterfaces::Base
{
public:
typedef enum
{
OFF,
PRESSED,
PRESSED_5, // 5...10s
PRESSED_10 //>10s
} ButtonState;
ButtonState state=OFF;
long pressCount=0;
};
DECLARE_TASKIF(IButtonTask);
#endif

View File

@@ -1,19 +0,0 @@
#ifndef _GWIBUTTONTASK_H
#define _GWIBUTTONTASK_H
#include "GwApi.h"
class IButtonTask : public GwApi::TaskInterfaces::Base
{
public:
typedef enum
{
OFF,
PRESSED,
PRESSED_5, // 5...10s
PRESSED_10 //>10s
} ButtonState;
ButtonState state=OFF;
long pressCount=0;
};
DECLARE_TASKIF(IButtonTask);
#endif

View File

@@ -2,7 +2,6 @@
//we only compile for some boards
#ifdef BOARD_TEST
#include "GwExampleTask.h"
#include "GwIExampleTask.h"
#include "GwApi.h"
#include "GWConfig.h"
#include <vector>

View File

@@ -12,8 +12,20 @@ void exampleInit(GwApi *param);
//let the core call an init function before the
//N2K Stuff and the communication is set up
//normally you should not need this at all
//especially this init function will register the real task at the core
//this gives you some flexibility to decide based on config or defines whether you
//really want to start the task or not
//this function must return when done - otherwise the core will not start up
DECLARE_INITFUNCTION(exampleInit);
/**
* an interface for the example task
*/
class ExampleTaskIf : public GwApi::TaskInterfaces::Base{
public:
long count=0;
String someValue;
};
DECLARE_TASKIF(ExampleTaskIf);
#endif

View File

@@ -1,14 +0,0 @@
#ifndef GWIEXAMPLETASK_H
#define GWIEXAMPLETASK_H
#include "GwApi.h"
/**
* an interface for the example task
*/
class ExampleTaskIf : public GwApi::TaskInterfaces::Base{
public:
long count=0;
String someValue;
};
DECLARE_TASKIF(ExampleTaskIf);
#endif

View File

@@ -2,7 +2,6 @@
#include "GwHardware.h"
#include "GwApi.h"
#include "FastLED.h"
#include "GwIButtonTask.h"
typedef enum {
LED_OFF,
LED_GREEN,

View File

@@ -93,7 +93,6 @@ class GwUserCapability{
}
};
#include "GwUserTasks.h"
#include "GwUserTasksIf.h"
class TaskDataEntry{
public: