11 #include "interpret.h"
12 #include "mTaskSymbols.h"
16 #include "interface.h"
18 #define MSG_GET_TASK 't'
19 #define MSG_DEL_TASK 'd'
20 #define MSG_SDS_SPEC 's'
21 #define MSG_SDS_DEL 'a'
22 #define MSG_SDS_UPD 'u'
24 void read_message(void)
27 if(input_available()){
28 uint8_t c
= read_byte();
29 debug("Receiving input: %c %02x\n", c
, c
);
32 debug("Receiving an sds");
36 debug("Receiving an sds update");
37 //TODO do something with the return value
41 debug("Receiving a delete SDS request");
45 debug("Receiving a delete task request");
49 debug("Receiving a task");
57 debug("Unknown message: %X", c
);
71 cyclestart
= millis();
72 for(ct
= 0; ct
<MAXTASKS
; ct
++){
73 //See whether the task is even in use
74 if((curtask
= task_get(ct
)) == NULL
){
75 // debug("Task %d not implemented\n", ct);
79 if(is_interrupt_task(curtask
) && had_interrupt(curtask
)){
80 debug("Interrupt task %d not implemented", ct
);
82 //Interval task, and interval passed
83 } else if(cyclestart
-curtask
->lastrun
> curtask
->interval
){
84 debug("Running interval task: %d", ct
);
87 //Oneshot task, thus disable
88 if(curtask
->interval
== 0){
89 curtask
->used
= false;
91 curtask
->lastrun
= cyclestart
;
99 int main(int argc
, char *argv
[]){
108 debug("sending device spec");
111 //Check for newetasks