diff --git a/extra_script.py b/extra_script.py index 0a4d68c..ce6e89e 100644 --- a/extra_script.py +++ b/extra_script.py @@ -22,7 +22,6 @@ CFG_INCLUDE='GwConfigDefinitions.h' CFG_INCLUDE_IMPL='GwConfigDefImpl.h' XDR_INCLUDE='GwXdrTypeMappings.h' TASK_INCLUDE='GwUserTasks.h' -TASK_INCLUDE_IF='GwUserTasksIf.h' EMBEDDED_INCLUDE="GwEmbeddedFiles.h" def getEmbeddedFiles(env): @@ -267,14 +266,12 @@ def checkAndAdd(file,names,ilist): if not match: return ilist.append(file) -def genereateUserTasks(outfile,forIf=False): +def genereateUserTasks(outfile): includes=[] for task in userTaskDirs: #print("##taskdir=%s"%task) base=os.path.basename(task) includeNames=[base.lower()+".h",'gw'+base.lower()+'.h'] - if forIf: - includeNames=["i"+base.lower()+".h",'gwi'+base.lower()+'.h'] for f in os.listdir(task): checkAndAdd(f,includeNames,includes) includeData="" @@ -403,7 +400,6 @@ def prebuild(env): print("#WARNING: infile %s for %s not found"%(inFile,ef)) generateEmbedded(filedefs,os.path.join(outPath(),EMBEDDED_INCLUDE)) genereateUserTasks(os.path.join(outPath(), TASK_INCLUDE)) - genereateUserTasks(os.path.join(outPath(), TASK_INCLUDE_IF),forIf=True) generateFile(os.path.join(basePath(),XDR_FILE),os.path.join(outPath(),XDR_INCLUDE),generateXdrMappings) version="dev"+datetime.now().strftime("%Y%m%d") env.Append(CPPDEFINES=[('GWDEVVERSION',version)]) diff --git a/lib/buttontask/GwButtonTask.cpp b/lib/buttontask/GwButtonTask.cpp index 72b84cf..908c3fa 100644 --- a/lib/buttontask/GwButtonTask.cpp +++ b/lib/buttontask/GwButtonTask.cpp @@ -1,5 +1,4 @@ #include "GwButtonTask.h" -#include "GwIButtonTask.h" #include "GwHardware.h" #include "GwApi.h" #include "GwLedTask.h" diff --git a/lib/buttontask/GwButtonTask.h b/lib/buttontask/GwButtonTask.h index 853e6c6..107b831 100644 --- a/lib/buttontask/GwButtonTask.h +++ b/lib/buttontask/GwButtonTask.h @@ -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 \ No newline at end of file diff --git a/lib/buttontask/GwIButtonTask.h b/lib/buttontask/GwIButtonTask.h deleted file mode 100644 index 45a019e..0000000 --- a/lib/buttontask/GwIButtonTask.h +++ /dev/null @@ -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 \ No newline at end of file diff --git a/lib/exampletask/GwExampleTask.cpp b/lib/exampletask/GwExampleTask.cpp index bccf2f7..340b785 100644 --- a/lib/exampletask/GwExampleTask.cpp +++ b/lib/exampletask/GwExampleTask.cpp @@ -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 diff --git a/lib/exampletask/GwExampleTask.h b/lib/exampletask/GwExampleTask.h index eb4e3f3..bc65ae9 100644 --- a/lib/exampletask/GwExampleTask.h +++ b/lib/exampletask/GwExampleTask.h @@ -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 \ No newline at end of file diff --git a/lib/exampletask/GwIExampleTask.h b/lib/exampletask/GwIExampleTask.h deleted file mode 100644 index 85b0c81..0000000 --- a/lib/exampletask/GwIExampleTask.h +++ /dev/null @@ -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 \ No newline at end of file diff --git a/lib/ledtask/GwLedTask.cpp b/lib/ledtask/GwLedTask.cpp index 3877a6c..5df1e9d 100644 --- a/lib/ledtask/GwLedTask.cpp +++ b/lib/ledtask/GwLedTask.cpp @@ -2,7 +2,6 @@ #include "GwHardware.h" #include "GwApi.h" #include "FastLED.h" -#include "GwIButtonTask.h" typedef enum { LED_OFF, LED_GREEN, diff --git a/lib/usercode/GwUserCode.cpp b/lib/usercode/GwUserCode.cpp index 0473910..2841731 100644 --- a/lib/usercode/GwUserCode.cpp +++ b/lib/usercode/GwUserCode.cpp @@ -93,7 +93,6 @@ class GwUserCapability{ } }; #include "GwUserTasks.h" -#include "GwUserTasksIf.h" class TaskDataEntry{ public: