repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update sub"
[mTask.git]
/
int
/
main.c
diff --git
a/int/main.c
b/int/main.c
index
bd0a428
..
3388f21
100644
(file)
--- a/
int/main.c
+++ b/
int/main.c
@@
-3,7
+3,8
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-#ifndef STM
+#ifdef STM
+#else
#include <stdio.h>
#endif
#include <stdio.h>
#endif
@@
-23,14
+24,15
@@
void read_message(void)
//Find next task
if(input_available()){
uint8_t c = read_byte();
//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:
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;
//TODO do something with the return value
sds_update();
break;
@@
-40,7
+42,10
@@
void read_message(void)
break;
case MSG_GET_TASK:
debug("Receiving a task");
break;
case MSG_GET_TASK:
debug("Receiving a task");
- task_register();
+ ct = task_register();
+ write_byte('t');
+ write16(ct);
+ write_byte('\n');
break;
case '\0':
break;
break;
case '\0':
break;
@@
-76,7
+81,13
@@
void loop(void)
debug("Current task to run: %d", ct);
run_task(curtask);
curtask->lastrun = cyclestart;
debug("Current task to run: %d", ct);
run_task(curtask);
curtask->lastrun = cyclestart;
-// write_byte('\n');
+ if(curtask->interval == 0){
+ curtask->used = false;
+ write_byte('m');
+ write_byte('d');
+ write_byte('\n');
+ }
+ write_byte('\n');
}
}
}
}
@@
-88,22
+99,16
@@
int main(int argc, char *argv[]){
gargv = argv;
#endif
gargv = argv;
#endif
- read_byte();
//Initialize systems
setup();
sds_init();
task_init();
//Initialize systems
setup();
sds_init();
task_init();
-
- while(!input_available()){
- delay(100);
- }
- debug("booting up");
-
+ //debug("booting up");
while(true){
//Check for newetasks
while(true){
//Check for newetasks
-
debug("loop");
+
//
debug("loop");
loop();
loop();
- delay(
1
0);
+ delay(
5
0);
}
return 0;
}
}
return 0;
}