working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Committer:
chaithanyarss
Date:
Sun Jul 03 09:47:05 2016 +0000
Revision:
215:570251b23c7b
Parent:
213:867de6d350fa
Child:
216:93505a6f8db7
Reset added

Who changed what in which revision?

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