CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
246:565458eefd94
Parent:
245:da9d1bd999da
Child:
251:c766afa330a3
--- a/ThreadsAndFunctions.h	Sun Jul 10 13:47:26 2016 +0000
+++ b/ThreadsAndFunctions.h	Sun Jul 10 21:32:28 2016 +0000
@@ -28,7 +28,7 @@
 //HK Thread(Contains HK_main() and PL_main())
 //RTOS timer calllback func
 void hk_isr(void const *args){
-    gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);
+    gHK_THREAD->signal_set(HK_SIGNAL);
 }
 
 
@@ -114,6 +114,7 @@
             gFLAGS = gFLAGS & (~UART_INT_FLAG);
             if( !(gFLAGS & COM_SESSION_FLAG) ){
                 // PENDING : DISABLE THREADS
+                HK_counter->stop();\
                 gPAY_SPI->bulkRead_pause();
                 gFLAGS = gFLAGS | COM_SESSION_FLAG;
                 gSESSION_TIMEOUT.attach(&after_session, SESSION_TIME_LIMIT);
@@ -198,6 +199,7 @@
                             reset_all;
                             gFLAGS = gFLAGS & (~COM_SESSION_VALIDITY);
                             // PENDING : ENABLE THREADS
+                            HK_counter->start(10000);\
                             gPAY_SPI->bulkRead_resume(&payload_isr_fun);
                             gSESSION_TIMEOUT.detach();
                             gFLAGS = gFLAGS & (~COM_SESSION_FLAG);
@@ -251,6 +253,7 @@
                 gFLAGS = gFLAGS & (~COM_MNG_TMTC_RUNNING_FLAG);
                 reset_all;
                 // PENDING : ENABLE THREADS
+                HK_counter->start(10000);
                 gPAY_SPI->bulkRead_resume(&payload_isr_fun);
                 gSESSION_TIMEOUT.detach();
                 gFLAGS = gFLAGS & (~COM_SESSION_FLAG);
@@ -291,6 +294,7 @@
             /*gPC.puts("session timeout: resetting in main\r\n");*/
             COM_POWER_OFF_TX;
             /*PENDING : ENABLE THREADS*/
+            HK_counter->start(10000);
             gPAY_SPI->bulkRead_resume(&payload_isr_fun);
             gSESSION_TIMEOUT.detach();
             gFLAGS = gFLAGS & (~COM_MNG_TMTC_RUNNING_FLAG);
@@ -303,6 +307,7 @@
             COM_POWER_OFF_TX;
             reset_all;
             // PENDING : ENABLE THREADS
+            HK_counter->start(10000);
             gPAY_SPI->bulkRead_resume(&payload_isr_fun);
             gSESSION_TIMEOUT.detach();
             gFLAGS = gFLAGS & (~COM_SESSION_FLAG);