11 #include "interpret.h"
12 #include "mTaskSymbols.h"
15 #include "interface.h"
17 #define MSG_GET_TASK 't'
18 #define MSG_DEL_TASK 'd'
19 #define MSG_SDS_SPEC 's'
20 #define MSG_SDS_DEL 'a'
21 #define MSG_SDS_UPD 'u'
23 void read_message(void)
26 if(input_available()){
27 uint8_t c
= read_byte();
28 debug("Receiving input: %c %02x\n", c
, c
);
31 debug("Receiving an sds");
35 debug("Receiving an sds update");
36 //TODO do something with the return value
40 debug("Receiving a delete SDS request");
44 debug("Receiving a delete task request");
48 debug("Receiving a task");
56 debug("Unknown message: %X", c
);
70 cyclestart
= millis();
71 for(ct
= 0; ct
<MAXTASKS
; ct
++){
72 //See whether the task is even in use
73 if((curtask
= task_get(ct
)) == NULL
){
74 // debug("Task %d not implemented\n", ct);
78 if(is_interrupt_task(curtask
) && had_interrupt(curtask
)){
79 debug("Interrupt task %d not implemented", ct
);
81 //Interval task, and interval passed
82 } else if(cyclestart
-curtask
->lastrun
> curtask
->interval
){
83 debug("Running interval task: %d", ct
);
86 //Oneshot task, thus disable
87 if(curtask
->interval
== 0){
88 curtask
->used
= false;
90 curtask
->lastrun
= cyclestart
;
98 int main(int argc
, char *argv
[]){
109 //Check for newetasks