Compression code changed and RLY_TMTC pointers managed

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
218:c63cdba0550f
Parent:
216:93505a6f8db7
--- a/COM_POWER_OFF_TX.h	Sun Jul 03 11:35:55 2016 +0000
+++ b/COM_POWER_OFF_TX.h	Sun Jul 03 15:25:24 2016 +0000
@@ -1,70 +1,3 @@
-#define RESET_CDMS {\
-    Base_tc *RESET_tc = new Short_tc;\
-    RESET_tc->next_TC = NULL;\
-    PUTshort_or_long(RESET_tc,SHORT_TC_CODE);\
-    PUTcrc_pass(RESET_tc,0x1);\
-    PUTexec_status(RESET_tc,0);\
-    RESET_tc->TC_string[0] = 0x01;\
-    RESET_tc->TC_string[1] = 0x81;\
-    RESET_tc->TC_string[2] = 0x81;\
-    RESET_tc->TC_string[3] = 0x38;\
-    RESET_tc->TC_string[4] = 0;\
-    RESET_tc->TC_string[5] = 0;\
-    RESET_tc->TC_string[6] = 0;\
-    RESET_tc->TC_string[7] = 0;\
-    RESET_tc->TC_string[8] = 0;\
-    uint16_t crc16 = crc16_gen(RESET_tc->TC_string, 9);\
-    RESET_tc->TC_string[9]  = (crc16 & 0xFF00)>>8;\
-    RESET_tc->TC_string[10] = (crc16 & 0x00FF);\
-    Base_tm *tm_ptr = NULL;\
-    tm_ptr =  FCTN_CDMS_RLY_TMTC(RESET_tc);\
-    delete RESET_tc;\
-    /*DELETE THE TM AFTER USE*/\
-    Base_tm *del_tm = tm_ptr;\
-    while( del_tm != NULL ){\
-        Base_tm *temp = del_tm->next_TM;\
-        delete del_tm;\
-        del_tm = temp;\
-    }\
-}
-
-#define power_on_bae {\
-    Base_tc *power_on_BAE = new Short_tc;\
-    power_on_BAE->next_TC = NULL;\
-    PUTshort_or_long(power_on_BAE,SHORT_TC_CODE);\
-    PUTcrc_pass(power_on_BAE,0x1);\
-    PUTexec_status(power_on_BAE,0);\
-    power_on_BAE->TC_string[0] = 0x01;\
-    power_on_BAE->TC_string[1] = BAE_APID_SOURCE;\
-    power_on_BAE->TC_string[2] = BAE_SERVICE;\
-    power_on_BAE->TC_string[3] = BAE_POWER_ON_PID;\
-    power_on_BAE->TC_string[4] = 0;\
-    power_on_BAE->TC_string[5] = 0;\
-    power_on_BAE->TC_string[6] = 0;\
-    power_on_BAE->TC_string[7] = 0;\
-    power_on_BAE->TC_string[8] = 0;\
-    uint16_t crc16 = crc16_gen(power_on_BAE->TC_string, 9);\
-    power_on_BAE->TC_string[9]  = (crc16 & 0xFF00)>>8;\
-    power_on_BAE->TC_string[10] = (crc16 & 0x00FF);\
-    Base_tm *tm_ptr = NULL;\
-    tm_ptr =  FCTN_CDMS_RLY_TMTC(power_on_BAE);\
-    delete power_on_BAE;\
-    /*DELETE THE TM AFTER USE*/\
-    Base_tm *del_tm = tm_ptr;\
-    int overCount = 0;\
-    while( del_tm != NULL ){\
-        if( (overCount < TM_OVERFLOW_CONSTANT) ){\
-            Base_tm *temp = del_tm->next_TM;\
-            delete del_tm;\
-            del_tm = temp;\
-            ++overCount;\
-        }\
-        else{\
-            RESET_CDMS;\
-            break;\
-        }\
-    }\
-}
 
 #define resume_bcn {\
     Base_tc *beacon_tc = new Long_tc;\
@@ -117,7 +50,7 @@
     RF_SW_CNTRL_BCN = 0;\
     gFLAGS = gFLAGS | RF_SW_STATUS_FLAG;\
     if( gFLAGS & COM_AUTO_POWER_OFF_BAE_FLAG ){\
-        power_on_bae;\
+        BAE_SW_EN_DS = 0;\
         gFLAGS = gFLAGS | BAE_SW_EN_FLAG;\
         gFLAGS & (~COM_AUTO_POWER_OFF_BAE_FLAG);\
         resume_bcn;\