Changes: bbram Checking Function Registers Checking Funcrtion Indivisual Register checking Functions

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Committer:
ee12b079
Date:
Sun Jan 03 12:01:42 2016 +0000
Revision:
28:cd3212fe5643
Parent:
19:27e5f2edaf26
Child:
34:f0b518523381
data partially matching for stand alone code as well

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 15:1c1ca992b43b 73 power_on_tm = power_on_tm_head;\
ee12b079 28:cd3212fe5643 74 gPC.printf("\n");\
shreeshas95 15:1c1ca992b43b 75 while(power_on_tm != NULL){\
shreeshas95 15:1c1ca992b43b 76 int length = TM_SHORT_SIZE;\
shreeshas95 15:1c1ca992b43b 77 if( GETshort_or_long_tm(power_on_tm->fields) == SHORT_TM_CODE ){\
shreeshas95 15:1c1ca992b43b 78 length = TM_SHORT_SIZE;\
shreeshas95 15:1c1ca992b43b 79 }\
shreeshas95 15:1c1ca992b43b 80 else{\
shreeshas95 15:1c1ca992b43b 81 length = TM_LONG_SIZE;\
shreeshas95 15:1c1ca992b43b 82 }\
shreeshas95 15:1c1ca992b43b 83 for(int i = 0 ; i < length ; ++i){\
ee12b079 28:cd3212fe5643 84 gPC.printf("0x%X,",power_on_tm->TM_string[i]);\
shreeshas95 15:1c1ca992b43b 85 }\
shreeshas95 15:1c1ca992b43b 86 power_on_tm = power_on_tm->next_TM;\
shreeshas95 15:1c1ca992b43b 87 }\
ee12b079 28:cd3212fe5643 88 gPC.printf("\n");\
krishanprajapat 19:27e5f2edaf26 89 snd_tm.head_pointer(power_on_tm_head);\
krishanprajapat 19:27e5f2edaf26 90 adf_not_SDcard;\
shreeshas95 4:104dd82c99b8 91 /*PENDING: TRANSMIT ABOVE TM*/\
shreeshas95 5:ab276a17ca07 92 /*deleting the telemetry*/\
shreeshas95 4:104dd82c99b8 93 power_on_tm = power_on_tm_head;\
shreeshas95 4:104dd82c99b8 94 overFlowCountADF = 0;\
shreeshas95 4:104dd82c99b8 95 while( power_on_tm != NULL ){\
shreeshas95 4:104dd82c99b8 96 if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\
shreeshas95 4:104dd82c99b8 97 Base_tm *temp = power_on_tm->next_TM;\
shreeshas95 4:104dd82c99b8 98 delete power_on_tm;\
shreeshas95 4:104dd82c99b8 99 power_on_tm = temp;\
shreeshas95 4:104dd82c99b8 100 ++overFlowCountADF;\
shreeshas95 4:104dd82c99b8 101 }\
shreeshas95 4:104dd82c99b8 102 else{\
shreeshas95 4:104dd82c99b8 103 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 104 break;\
shreeshas95 4:104dd82c99b8 105 }\
shreeshas95 4:104dd82c99b8 106 }\
shreeshas95 4:104dd82c99b8 107 }\
shreeshas95 4:104dd82c99b8 108 else{\
shreeshas95 4:104dd82c99b8 109 /*PENDING: COM_POWER OFF TX*/\
shreeshas95 4:104dd82c99b8 110 /*PENDING: CDMS HK MAIN*/\
shreeshas95 4:104dd82c99b8 111 uint8_t ackReceived = 0x00;\
shreeshas95 4:104dd82c99b8 112 /*PENDING: BCN TX MAIN*/\
shreeshas95 4:104dd82c99b8 113 if( ackReceived == 0xFF ){\
shreeshas95 4:104dd82c99b8 114 gCOM_MNG_TMTC_THREAD->wait(5000);\
shreeshas95 4:104dd82c99b8 115 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 116 }\
shreeshas95 4:104dd82c99b8 117 else{\
shreeshas95 4:104dd82c99b8 118 /*PENDING: RESET CDMS*/\
shreeshas95 4:104dd82c99b8 119 }\
shreeshas95 4:104dd82c99b8 120 }\
aniruddhv 12:ffdb29353058 121 /*gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");*/\
shreeshas95 4:104dd82c99b8 122 }