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
);
60 printf("no input...\n");
73 cyclestart
= millis();
74 for(ct
= 0; ct
<MAXTASKS
; ct
++){
75 //See whether the task is even in use
76 if((curtask
= task_get(ct
)) == NULL
){
77 // debug("Task %d not implemented\n", ct);
80 //See whether the task interval has passed
81 if(cyclestart
-curtask
->lastrun
< curtask
->interval
){
82 // debug("Task %d not scheduled\n", ct);
85 debug("Current task to run: %d", ct
);
87 curtask
->lastrun
= cyclestart
;
88 if(curtask
->interval
== 0){
89 curtask
->used
= false;
101 int main(int argc
, char *argv
[]){
112 //Check for newetasks