Dummy program to demonstrate problems: working code
Dependencies: SLCD mbed-rtos mbed
Fork of MNG_TC by
Diff: ThreadFunctions.h
- Revision:
- 11:109f16cc35d7
- Parent:
- 10:024c2ef51cb1
--- a/ThreadFunctions.h Thu Jul 16 14:14:41 2015 +0000 +++ b/ThreadFunctions.h Fri Jul 17 07:31:49 2015 +0000 @@ -23,6 +23,34 @@ VAR_SPACE::rx_new_node = VAR_SPACE::head_data; } +void after_receive(void){ + rx_timeout.detach(); + VAR_SPACE::rx_new_node->val = 0x00; + + if(first_time){ + first_time = false; + pass_time.attach(&after_pass, PASS_TIME_LIMIT); + } + + VAR_SPACE::new_tc_received = true; + VAR_SPACE::mng_tmtc_thread->signal_set(0x01); +} + + +void com_rcv_tc_fun(const void *args){ + + while(true){ + Thread::signal_wait(0x01); + + //~ allocate new node + VAR_SPACE::rx_new_node->next = new data_list; + VAR_SPACE::rx_new_node = VAR_SPACE::rx_new_node->next; + VAR_SPACE::rx_new_node->next = NULL; + + rx_timeout.attach(&after_receive, RX_TIMEOUT_LIMIT); + } +} + void com_mng_fun(const void *args){ while(true){