CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Tue Jul 05 16:04:31 2016 +0000
Parent:
231:b1458c1e9199
Child:
235:c127b15409b2
Child:
243:29625f5fc745
Commit message:
added facility for dummy BAE_TC

Changed in this revision

COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
--- 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