15 #include "interpret.h"
16 #include "mTaskSymbols.h"
20 #include "interface.h"
22 #define MSG_GET_TASK 't'
23 #define MSG_DEL_TASK 'd'
24 #define MSG_SDS_SPEC 's'
25 #define MSG_SDS_DEL 'a'
26 #define MSG_SDS_UPD 'u'
29 void read_message(void)
32 if(input_available()){
33 uint8_t c
= read_byte();
34 debug("Receiving input: %c %02x\n", c
, c
);
37 debug("Receiving an sds");
41 debug("Receiving an sds update");
42 //TODO do something with the return value
46 debug("Receiving a delete SDS request");
50 debug("Receiving a delete task request");
54 debug("Receiving a task");
58 debug("Receiving a spec request");
62 debug("Server closed connection");
67 debug("Unknown message: %X", c
);
81 cyclestart
= millis();
82 for(ct
= 0; ct
<MAXTASKS
; ct
++){
83 //See whether the task is even in use
84 if((curtask
= task_get(ct
)) == NULL
){
85 // debug("Task %d not implemented\n", ct);
89 if(is_interrupt_task(curtask
) && had_interrupt(curtask
)){
90 debug("Interrupt task %d not implemented", ct
);
92 //Interval task, and interval passed
93 } else if(cyclestart
-curtask
->lastrun
> curtask
->interval
){
94 debug("Running interval task: %d", ct
);
97 //Oneshot task, thus disable
98 if(curtask
->interval
== 0){
99 curtask
->used
= false;
101 curtask
->lastrun
= cyclestart
;
108 #elif defined NODEMCU
109 void ICACHE_FLASH_ATTR
user_init(){
111 int main(int argc
, char *argv
[]){
120 debug("sending device spec");