repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add reset functionality
[mTask.git]
/
client
/
task.c
diff --git
a/client/task.c
b/client/task.c
index
050784c
..
2b42fd8
100644
(file)
--- a/
client/task.c
+++ b/
client/task.c
@@
-29,6
+29,9
@@
void task_register(void)
}
}
+ //Read return type
+ t->type = read_byte();
+
//Read tasklength
t->tasklength = read16();
debug("task interval: %d, length: %d\n", t->interval, t->tasklength);
//Read tasklength
t->tasklength = read16();
debug("task interval: %d, length: %d\n", t->interval, t->tasklength);
@@
-50,9
+53,11
@@
void task_register(void)
debug("Received a task of length %d", t->tasklength);
t->lastrun = 0L;
t->taskid = taskid++;
debug("Received a task of length %d", t->tasklength);
t->lastrun = 0L;
t->taskid = taskid++;
+ t->value = 0;
write_byte('t');
write16(t->taskid);
write_byte('t');
write16(t->taskid);
+ write16(mem_free());
write_byte('\n');
debug("free memory: %lu\n", mem_free());
}
write_byte('\n');
debug("free memory: %lu\n", mem_free());
}
@@
-83,7
+88,6
@@
struct task *task_next(struct task *t)
void task_delete(uint8_t c)
{
debug("Going to delete task: %i", c);
void task_delete(uint8_t c)
{
debug("Going to delete task: %i", c);
- debug("mem_task: %p", mem_task);
struct task *t = task_head();
while(t != NULL){
if(t->taskid == c){
struct task *t = task_head();
while(t != NULL){
if(t->taskid == c){
@@
-91,6
+95,11
@@
void task_delete(uint8_t c)
}
t = task_next(t);
}
}
t = task_next(t);
}
+ //Write acknowledgement
+ write_byte('d');
+ write16(c);
+ write16(t->value);
+ write_byte('\n');
if(t != NULL){
//We found the task, now we move everything from the end of the task up
if(t != NULL){
//We found the task, now we move everything from the end of the task up
@@
-105,5
+114,4
@@
void task_delete(uint8_t c)
//Decrement the spacepointer
mem_task -= end-start;
}
//Decrement the spacepointer
mem_task -= end-start;
}
- debug("mem_task: %p", mem_task);
}
}