X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Ftask.c;h=6e7ae0c39f044a7b86e3525d642797e2ed8f9c78;hb=HEAD;hp=e36600dfee838a29e715774cb888e02117a9ad92;hpb=cc93aff1c0867a33c41b4120c001b407d1b8850a;p=mTask.git diff --git a/client/task.c b/client/task.c index e36600d..6e7ae0c 100644 --- a/client/task.c +++ b/client/task.c @@ -6,10 +6,7 @@ #include "interface.h" #include "mem.h" -extern uint8_t *mem_top; -extern uint8_t *mem_bottom; -extern uint8_t *mem_task; -extern uint8_t *mem_sds; +extern uint8_t *mem_top, *mem_bottom, *mem_task, *mem_sds; uint8_t taskid = 0; @@ -53,9 +50,11 @@ void task_register(void) debug("Received a task of length %d", t->tasklength); t->lastrun = 0L; t->taskid = taskid++; + t->value = 0; write_byte('t'); write16(t->taskid); + write16(mem_free()); write_byte('\n'); debug("free memory: %lu\n", mem_free()); } @@ -86,7 +85,6 @@ struct task *task_next(struct task *t) 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){ @@ -94,6 +92,10 @@ void task_delete(uint8_t c) } t = task_next(t); } + //Write deletion spec + write_byte('d'); + write16(c); + write_byte('\n'); if(t != NULL){ //We found the task, now we move everything from the end of the task up @@ -108,5 +110,4 @@ void task_delete(uint8_t c) //Decrement the spacepointer mem_task -= end-start; } - debug("mem_task: %p", mem_task); }