CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
185:3b3cd96a7811
Parent:
181:834d02830729
Child:
186:eb19a02f83d6
Child:
187:1140091f5cec
--- a/main.cpp	Sat Jun 11 10:05:52 2016 +0000
+++ b/main.cpp	Fri Jun 17 11:36:22 2016 +0000
@@ -33,12 +33,41 @@
 #include "Compression.h"
 #include "ThreadsAndFunctions.h"
 
+#define PL_TC(tm_ptr){\
+    Base_tc *beacon_tc = new Short_tc;\
+    beacon_tc->next_TC = NULL;\
+    PUTshort_or_long(beacon_tc,SHORT_TC_CODE);\
+    PUTcrc_pass(beacon_tc,0x1);\
+    PUTexec_status(beacon_tc,0);\
+    beacon_tc->TC_string[0] = 0x01;\
+    beacon_tc->TC_string[1] = 0xE0;\
+    beacon_tc->TC_string[2] = 0x81;\
+    beacon_tc->TC_string[3] = 0xD0;\
+    beacon_tc->TC_string[4] = 0x00;\
+    beacon_tc->TC_string[5] = 0;\
+    beacon_tc->TC_string[6] = 0;\
+    beacon_tc->TC_string[7] = 0;\
+    beacon_tc->TC_string[8] = 0;\
+    uint16_t crc16 = crc16_gen(beacon_tc->TC_string, 9);\
+    beacon_tc->TC_string[9]  = (crc16 & 0xFF00)>>8;\
+    beacon_tc->TC_string[10] = (crc16 & 0x00FF);\
+    tm_ptr =  FCTN_CDMS_RLY_TMTC(beacon_tc);\
+}
+
 //void set_sig(){gSCIENCE_THREAD->signal_set(SCIENCE_SIGNAL);}
 int main()
 {
     
+    CDMS_I2C_GPIO = 0; 
+    PYLD_I2C_GPIO = 0; 
     
-    CDMS_I2C_GPIO = 0;  
+    gPC.printf("PL_TC sending\r\n");
+    
+    Base_tm *tm_ptr = new Short_tm;
+    PL_TC(tm_ptr);
+    
+    gPC.printf("PL_TC sent");
+    
     //gLEDR = 1;
     
     // ******************INITIALISATIONS START******************
@@ -72,6 +101,8 @@
     gPC.puts("welcome to mng_tmtc\r\n");
     #endif
     
+    
+    
     // COM_MNG_TMTC THREAD
     gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN);
     gCOM_MNG_TMTC_THREAD->set_priority(osPriorityHigh);