pl ack in tmtc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE_pl123 by shubham c

Committer:
aniruddhv
Date:
Thu Dec 31 11:49:42 2015 +0000
Revision:
12:ffdb29353058
Parent:
5:ab276a17ca07
Child:
15:1c1ca992b43b
Removed Print statements

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shreeshas95 4:104dd82c99b8 1 #define COM_POWER_ON_TX {\
aniruddhv 12:ffdb29353058 2 /*gPC.puts("Inside COM_POWER_ON_TX\r\n");*/\
shreeshas95 4:104dd82c99b8 3 if( !(gFLAGS & COM_TX_FLAG) ){\
shreeshas95 4:104dd82c99b8 4 gFLAGS = gFLAGS | COM_TX_FLAG;\
shreeshas95 5:ab276a17ca07 5 /*WARNING: INFINITE WHILE LOOP POSSIBLE: if standby ack received and bcn tx main status = 0*/\
shreeshas95 5:ab276a17ca07 6 bool retryFlag = true;\
shreeshas95 4:104dd82c99b8 7 while( retryFlag == true ){\
shreeshas95 5:ab276a17ca07 8 uint8_t standbyAck = 0xFF;\
shreeshas95 4:104dd82c99b8 9 /*PENDING: SET BEACON TO STANDBY*/\
shreeshas95 4:104dd82c99b8 10 if( standbyAck == 0xFF ){\
shreeshas95 5:ab276a17ca07 11 /*ACK RECCEIVED*/\
shreeshas95 4:104dd82c99b8 12 /*PENDING: BEACON TX MAIN STATUS*/\
shreeshas95 4:104dd82c99b8 13 if( true ){\
shreeshas95 4:104dd82c99b8 14 retryFlag = false;\
shreeshas95 4:104dd82c99b8 15 /*PENDING: SWITCH RELAY TO COM_TX*/\
shreeshas95 4:104dd82c99b8 16 /*PENDING: RF_SW_STATUS = RF_COM_TX*/\
shreeshas95 4:104dd82c99b8 17 }\
shreeshas95 4:104dd82c99b8 18 else{\
shreeshas95 4:104dd82c99b8 19 gCOM_MNG_TMTC_THREAD->wait(5000);\
shreeshas95 4:104dd82c99b8 20 }\
shreeshas95 4:104dd82c99b8 21 }\
shreeshas95 4:104dd82c99b8 22 else{\
shreeshas95 4:104dd82c99b8 23 /*PENDING: RESET BAE*/\
shreeshas95 4:104dd82c99b8 24 uint8_t standbyAck2 = 0x00;\
shreeshas95 4:104dd82c99b8 25 /*PENDING: SET BEACON TO STANDBY*/\
shreeshas95 4:104dd82c99b8 26 if( standbyAck2 == 0xFF ){\
shreeshas95 4:104dd82c99b8 27 /*PENDING: BEACON TX MAIN STAUTS*/\
shreeshas95 4:104dd82c99b8 28 if( true ){\
shreeshas95 4:104dd82c99b8 29 retryFlag = false;\
shreeshas95 4:104dd82c99b8 30 /*PENDING: SWITCH RF RELAY TO COM TX*/\
shreeshas95 4:104dd82c99b8 31 /*PENDING: RF_SW_STATUS = RF_COM_TX*/\
shreeshas95 4:104dd82c99b8 32 }\
shreeshas95 4:104dd82c99b8 33 }\
shreeshas95 4:104dd82c99b8 34 else{\
shreeshas95 4:104dd82c99b8 35 retryFlag = false;\
shreeshas95 4:104dd82c99b8 36 /*PENDING: POWER OFF BEACON*/\
shreeshas95 4:104dd82c99b8 37 /*PENDING: CLEAR BAE SW_EN*/\
shreeshas95 4:104dd82c99b8 38 /*PENDING: SWITCH RF RELAY TO COM TX*/\
shreeshas95 4:104dd82c99b8 39 /*PENDING: RF_SW_STATUS = RF_COM_TX*/\
shreeshas95 4:104dd82c99b8 40 }\
shreeshas95 4:104dd82c99b8 41 }\
shreeshas95 4:104dd82c99b8 42 }\
shreeshas95 4:104dd82c99b8 43 }\
shreeshas95 4:104dd82c99b8 44 /*PENDING: POWER ON COM_TX*/\
shreeshas95 5:ab276a17ca07 45 uint8_t adfConfigPass = 0xFF;\
shreeshas95 4:104dd82c99b8 46 for( int i = 0 ; i < COM_TX_CONFIG_LIMIT ; ++i ){\
shreeshas95 4:104dd82c99b8 47 /*PENDING: CONFIGURE ADF*/\
shreeshas95 4:104dd82c99b8 48 if( adfConfigPass == 0xFF ){\
shreeshas95 4:104dd82c99b8 49 break;\
shreeshas95 4:104dd82c99b8 50 }\
shreeshas95 4:104dd82c99b8 51 }\
shreeshas95 4:104dd82c99b8 52 if( adfConfigPass == 0xFF ){\
shreeshas95 4:104dd82c99b8 53 /*adf successfully configured*/\
shreeshas95 4:104dd82c99b8 54 /*CALL SIGN*/\
shreeshas95 4:104dd82c99b8 55 Base_tm *power_on_tm = NULL;\
shreeshas95 4:104dd82c99b8 56 Base_tm *power_on_tm_head = NULL;\
shreeshas95 4:104dd82c99b8 57 get_call_sign( power_on_tm_head );\
shreeshas95 4:104dd82c99b8 58 power_on_tm = power_on_tm_head;\
shreeshas95 4:104dd82c99b8 59 /*ACK L1*/\
shreeshas95 4:104dd82c99b8 60 get_ack_l1(power_on_tm->next_TM);\
shreeshas95 4:104dd82c99b8 61 int overFlowCountADF = 0;\
shreeshas95 4:104dd82c99b8 62 while( power_on_tm->next_TM != NULL ){\
shreeshas95 4:104dd82c99b8 63 if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\
shreeshas95 4:104dd82c99b8 64 power_on_tm = power_on_tm->next_TM;\
shreeshas95 4:104dd82c99b8 65 ++overFlowCountADF;\
shreeshas95 4:104dd82c99b8 66 }\
shreeshas95 4:104dd82c99b8 67 else{\
shreeshas95 4:104dd82c99b8 68 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 69 break;\
shreeshas95 4:104dd82c99b8 70 }\
shreeshas95 4:104dd82c99b8 71 }\
shreeshas95 4:104dd82c99b8 72 get_tc_list(power_on_tm->next_TM, 0x00);\
shreeshas95 4:104dd82c99b8 73 /*PENDING: TRANSMIT ABOVE TM*/\
shreeshas95 5:ab276a17ca07 74 /*deleting the telemetry*/\
shreeshas95 4:104dd82c99b8 75 power_on_tm = power_on_tm_head;\
shreeshas95 4:104dd82c99b8 76 overFlowCountADF = 0;\
shreeshas95 4:104dd82c99b8 77 while( power_on_tm != NULL ){\
shreeshas95 4:104dd82c99b8 78 if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\
shreeshas95 4:104dd82c99b8 79 Base_tm *temp = power_on_tm->next_TM;\
shreeshas95 4:104dd82c99b8 80 delete power_on_tm;\
shreeshas95 4:104dd82c99b8 81 power_on_tm = temp;\
shreeshas95 4:104dd82c99b8 82 ++overFlowCountADF;\
shreeshas95 4:104dd82c99b8 83 }\
shreeshas95 4:104dd82c99b8 84 else{\
shreeshas95 4:104dd82c99b8 85 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 86 break;\
shreeshas95 4:104dd82c99b8 87 }\
shreeshas95 4:104dd82c99b8 88 }\
shreeshas95 4:104dd82c99b8 89 }\
shreeshas95 4:104dd82c99b8 90 else{\
shreeshas95 4:104dd82c99b8 91 /*PENDING: COM_POWER OFF TX*/\
shreeshas95 4:104dd82c99b8 92 /*PENDING: CDMS HK MAIN*/\
shreeshas95 4:104dd82c99b8 93 uint8_t ackReceived = 0x00;\
shreeshas95 4:104dd82c99b8 94 /*PENDING: BCN TX MAIN*/\
shreeshas95 4:104dd82c99b8 95 if( ackReceived == 0xFF ){\
shreeshas95 4:104dd82c99b8 96 gCOM_MNG_TMTC_THREAD->wait(5000);\
shreeshas95 4:104dd82c99b8 97 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 98 }\
shreeshas95 4:104dd82c99b8 99 else{\
shreeshas95 4:104dd82c99b8 100 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 101 }\
shreeshas95 4:104dd82c99b8 102 }\
aniruddhv 12:ffdb29353058 103 /*gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");*/\
shreeshas95 4:104dd82c99b8 104 }