CDMS code for testing sbc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Revision:
218:c63cdba0550f
Parent:
217:93505a6f8db7
--- a/COM_POWER_ON_TX.h	Sun Jul 03 11:35:55 2016 +0000
+++ b/COM_POWER_ON_TX.h	Sun Jul 03 15:25:24 2016 +0000
@@ -1,3 +1,5 @@
+extern void rx_read();
+
 #define STANDBY_PRCS(tm_ptr){\
     Base_tc *stdby_tc = new Long_tc;\
     stdby_tc->next_TC = NULL;\
@@ -48,82 +50,6 @@
     delete beacon_tc;\
 }
 
-#define reset_bae {\
-    Base_tc *reset_BAE = new Short_tc;\
-    reset_BAE->next_TC = NULL;\
-    PUTshort_or_long(reset_BAE,SHORT_TC_CODE);\
-    PUTcrc_pass(reset_BAE,0x1);\
-    PUTexec_status(reset_BAE,0);\
-    reset_BAE->TC_string[0] = 0x01;\
-    reset_BAE->TC_string[1] = BAE_APID_SOURCE;\
-    reset_BAE->TC_string[2] = BAE_SERVICE;\
-    reset_BAE->TC_string[3] = BAE_RESET_PID;\
-    reset_BAE->TC_string[4] = 0;\
-    reset_BAE->TC_string[5] = 0;\
-    reset_BAE->TC_string[6] = 0;\
-    reset_BAE->TC_string[7] = 0;\
-    reset_BAE->TC_string[8] = 0;\
-    uint16_t crc16 = crc16_gen(reset_BAE->TC_string, 9);\
-    reset_BAE->TC_string[9]  = (crc16 & 0xFF00)>>8;\
-    reset_BAE->TC_string[10] = (crc16 & 0x00FF);\
-    Base_tm *tm_ptr = NULL;\
-    tm_ptr =  FCTN_CDMS_RLY_TMTC(reset_BAE);\
-    delete reset_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 power_off_bae {\
-    Base_tc *power_off_BAE = new Short_tc;\
-    power_off_BAE->next_TC = NULL;\
-    PUTshort_or_long(power_off_BAE,SHORT_TC_CODE);\
-    PUTcrc_pass(power_off_BAE,0x1);\
-    PUTexec_status(power_off_BAE,0);\
-    power_off_BAE->TC_string[0] = 0x01;\
-    power_off_BAE->TC_string[1] = BAE_APID_SOURCE;\
-    power_off_BAE->TC_string[2] = BAE_SERVICE;\
-    power_off_BAE->TC_string[3] = BAE_POWER_OFF_PID;\
-    power_off_BAE->TC_string[4] = 0;\
-    power_off_BAE->TC_string[5] = 0;\
-    power_off_BAE->TC_string[6] = 0;\
-    power_off_BAE->TC_string[7] = 0;\
-    power_off_BAE->TC_string[8] = 0;\
-    uint16_t crc16 = crc16_gen(power_off_BAE->TC_string, 9);\
-    power_off_BAE->TC_string[9]  = (crc16 & 0xFF00)>>8;\
-    power_off_BAE->TC_string[10] = (crc16 & 0x00FF);\
-    Base_tm *tm_ptr = NULL;\
-    tm_ptr = FCTN_CDMS_RLY_TMTC(power_off_BAE);\
-    delete power_off_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 P_CDMS_HK_MAIN {\
     Base_tc *hk_main_ptr = new Short_tc;\
     hk_main_ptr->next_TC = NULL;\
@@ -213,7 +139,7 @@
                     }
                 }
                 else{
-                    reset_bae;
+                    RST_BAE();
                     Base_tm *tm_ptr2 = NULL;
                     SET_BCN_STANDBY(tm_ptr2);
                     uint8_t standbyAck2 = 0;
@@ -232,7 +158,7 @@
                     }
                     else{
                         retryFlag = false;
-                        power_off_bae;
+                        SW_OFF_BAE();
                         gFLAGS = gFLAGS | COM_AUTO_POWER_OFF_BAE_FLAG;
                         gFLAGS = gFLAGS & (~BAE_SW_EN_FLAG);
                         RF_SW_CNTRL_TX = 1;