Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
COM_POWER_ON_TX.h
- Committer:
- ee12b079
- Date:
- 2016-01-22
- Revision:
- 90:df55a5f68331
- Parent:
- 69:20f09a0c3fd2
- Child:
- 95:42d6747900cb
File content as of revision 90:df55a5f68331:
#define COM_POWER_ON_TX {\
/*gPC.puts("Inside COM_POWER_ON_TX\r\n");*/\
if( !(gFLAGS & COM_TX_FLAG) ){\
gFLAGS = gFLAGS | COM_TX_FLAG;\
/*WARNING: INFINITE WHILE LOOP POSSIBLE: if standby ack received and bcn tx main status = 0*/\
bool retryFlag = true;\
while( retryFlag == true ){\
uint8_t standbyAck = 0xFF;\
/*PENDING: SET BEACON TO STANDBY*/\
if( standbyAck == 0xFF ){\
/*ACK RECCEIVED*/\
/*PENDING: BEACON TX MAIN STATUS*/\
if( true ){\
retryFlag = false;\
/*PENDING: SWITCH RELAY TO COM_TX*/\
/*PENDING: RF_SW_STATUS = RF_COM_TX*/\
}\
else{\
gCOM_MNG_TMTC_THREAD->wait(5000);\
}\
}\
else{\
/*PENDING: RESET BAE*/\
uint8_t standbyAck2 = 0x00;\
/*PENDING: SET BEACON TO STANDBY*/\
if( standbyAck2 == 0xFF ){\
/*PENDING: BEACON TX MAIN STAUTS*/\
if( true ){\
retryFlag = false;\
/*PENDING: SWITCH RF RELAY TO COM TX*/\
/*PENDING: RF_SW_STATUS = RF_COM_TX*/\
}\
}\
else{\
retryFlag = false;\
/*PENDING: POWER OFF BEACON*/\
/*PENDING: CLEAR BAE SW_EN*/\
/*PENDING: SWITCH RF RELAY TO COM TX*/\
/*PENDING: RF_SW_STATUS = RF_COM_TX*/\
}\
}\
}\
}\
/*PENDING: POWER ON COM_TX*/\
uint8_t adfConfigPass = 0xFF;\
for( int i = 0 ; i < COM_TX_CONFIG_LIMIT ; ++i ){\
/*PENDING: CONFIGURE ADF*/\
if( adfConfigPass == 0xFF ){\
break;\
}\
}\
if( adfConfigPass == 0xFF ){\
/*adf successfully configured*/\
/*CALL SIGN*/\
Base_tm *power_on_tm = NULL;\
Base_tm *power_on_tm_head = NULL;\
get_call_sign( power_on_tm_head );\
power_on_tm = power_on_tm_head;\
/*ACK L1*/\
get_ack_l1(power_on_tm->next_TM);\
int overFlowCountADF = 0;\
while( power_on_tm->next_TM != NULL ){\
if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\
power_on_tm = power_on_tm->next_TM;\
++overFlowCountADF;\
}\
else{\
/*PENDING: RESET CDMS*/\
break;\
}\
}\
get_tc_list(power_on_tm->next_TM, 0x00);\
/*PENDING: TRANSMIT ABOVE TM*/\
/*Call Sign, ACK_L1, TC_LIST*/\
/*snd_tm.head_pointer(power_on_tm_head);*/\
/*adf_not_SDcard;*/\
/*deleting the telemetry*/\
power_on_tm = power_on_tm_head;\
overFlowCountADF = 0;\
while( power_on_tm != NULL ){\
if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\
Base_tm *temp = power_on_tm->next_TM;\
delete power_on_tm;\
power_on_tm = temp;\
++overFlowCountADF;\
}\
else{\
/*PENDING: RESET CDMS*/\
break;\
}\
}\
}\
else{\
/*PENDING: COM_POWER OFF TX*/\
/*PENDING: CDMS HK MAIN*/\
uint8_t ackReceived = 0x00;\
/*PENDING: BCN TX MAIN*/\
if( ackReceived == 0xFF ){\
gCOM_MNG_TMTC_THREAD->wait(5000);\
/*PENDING: RESET CDMS*/\
}\
else{\
/*PENDING: RESET CDMS*/\
}\
}\
/*gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");*/\
}
