TELECOMMAND MANAGER V1

Dependencies:   mbed SLCD mbed-rtos

Revision:
13:7b27a8e9cbb4
Parent:
10:024c2ef51cb1
Child:
14:a4c259ca0325
--- a/ThreadFunctions.h	Thu Jul 16 14:14:41 2015 +0000
+++ b/ThreadFunctions.h	Mon Aug 03 14:29:35 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){
         
@@ -66,4 +94,14 @@
             }
         }
     }
-}
\ No newline at end of file
+}
+
+
+//void com_pay_thread_fun(void const *args){
+//    while(true){
+//        VAR_SPACE::COM_payload_thread->signal_wait(0x01);
+//        //read rtc time later
+//        uint64_t RTC_time = 0;
+//        Science_Data_Compression::complete_compression( VAR_SPACE::payload_dma_buffer , RTC_time);
+//    }
+//}
\ No newline at end of file