working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Revision:
233:bfce738e43e8
Parent:
232:b1458c1e9199
Child:
236:ccbd1a7778b1
Child:
237:12061b714e47
Child:
243:29625f5fc745
Child:
248:407ab7e337cd
--- a/COM_MNG_TMTC.h	Tue Jul 05 11:52:47 2016 +0000
+++ b/COM_MNG_TMTC.h	Tue Jul 05 16:04:31 2016 +0000
@@ -16,6 +16,26 @@
 //DigitalIn tm_status_4m_pl(PIN61); //I2C interrupt to CDMS from PL
 #define RESET_CDMS NVIC_SystemReset()
 
+#define BAE_TC{\
+    tc_ptr->next_TC = NULL;\
+    PUTshort_or_long(tc_ptr,SHORT_TC_CODE);\
+    PUTcrc_pass(tc_ptr,0x1);\
+    PUTexec_status(tc_ptr,0);\
+    tc_ptr->TC_string[0] = 0x01;\
+    tc_ptr->TC_string[1] = 0x60;\
+    tc_ptr->TC_string[2] = 0x81;\
+    tc_ptr->TC_string[3] = 0x21;\
+    tc_ptr->TC_string[4] = 0x00;\
+    tc_ptr->TC_string[5] = 0;\
+    tc_ptr->TC_string[6] = 0;\
+    tc_ptr->TC_string[7] = 0;\
+    tc_ptr->TC_string[8] = 0;\
+    uint16_t crc16 = crc16_gen(tc_ptr->TC_string, 9);\
+    tc_ptr->TC_string[9]  = (crc16 & 0xFF00)>>8;\
+    tc_ptr->TC_string[10] = (crc16 & 0x00FF);\
+}
+
+
 uint8_t received = 0;
 uint16_t mid1;
 uint16_t mid2;
@@ -358,6 +378,7 @@
         case 1: //apid=01 implies it corresponds to bae
         {
             BAE_I2C_mutex.lock();
+            BAE_TC;
             gPC.printf("Telecommand is for BAE\r\n");
             gPC.printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
             y = FCTN_I2C_WRITE((char*)tc_ptr->TC_string,TC_LONG_SIZE);                         // Check for SHORT and LONG TC and then send