#include <stdlib.h>
#include <string.h>
-#ifndef STM
+#ifdef STM
+#else
#include <stdio.h>
#endif
//Find next task
if(input_available()){
uint8_t c = read_byte();
- debug("Receiving input: %c\n", c);
+ 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;
break;
case MSG_GET_TASK:
debug("Receiving a task");
+ // write_dpin(0, true);
task_register();
+ // write_dpin(0, false);
break;
case '\0':
break;
debug("Current task to run: %d", ct);
run_task(curtask);
curtask->lastrun = cyclestart;
-// write_byte('\n');
}
}
gargv = argv;
#endif
- read_byte();
//Initialize systems
setup();
sds_init();
task_init();
-
- while(!input_available()){
- delay(100);
- }
- debug("booting up");
-
+ //debug("booting up");
while(true){
//Check for newetasks
- debug("loop");
+// debug("loop");
loop();
- delay(100);
+ delay(50);
}
return 0;
}