X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=int%2Fmain.c;h=00c9f82999a5d632b4d56c1cf2d63892c77cc690;hb=3698f150b0c5e5ebed23b0885ced2711ef16d9f5;hp=9b6a88bc03164b76803205dfc5314c58366eb3c7;hpb=3cac8340c7c822ecda3783286196c6bc4cdec66a;p=mTask.git diff --git a/int/main.c b/int/main.c index 9b6a88b..00c9f82 100644 --- a/int/main.c +++ b/int/main.c @@ -3,7 +3,8 @@ #include #include -#ifndef STM +#ifdef STM +#else #include #endif @@ -23,14 +24,15 @@ void read_message(void) //Find next task if(input_available()){ uint8_t c = read_byte(); - debug("Receiving input: %c\n", c); + uint8_t ct; + debug("Receiving input: %c %02x\n", c, c); switch(c){ case MSG_SDS_SPEC: debug("Receiving an sds"); sds_register(); break; case MSG_SDS_UPD: - debug("Receiving an sds"); + debug("Receiving an sds update"); //TODO do something with the return value sds_update(); break; @@ -40,9 +42,10 @@ void read_message(void) break; case MSG_GET_TASK: debug("Receiving a task"); - write_dpin(0, true); - task_register(); - write_dpin(0, false); + ct = task_register(); + write_byte('t'); + write_byte(ct+'0'); + write_byte('\n'); break; case '\0': break; @@ -78,7 +81,6 @@ void loop(void) debug("Current task to run: %d", ct); run_task(curtask); curtask->lastrun = cyclestart; - write_byte('\n'); } } @@ -94,14 +96,12 @@ int main(int argc, char *argv[]){ setup(); sds_init(); task_init(); - - debug("booting up"); - write_byte('\n'); + //debug("booting up"); while(true){ //Check for newetasks - debug("loop"); +// debug("loop"); loop(); - delay(100); + delay(50); } return 0; }