To fix the hang problem
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
COM_POWER_ON_TX.h@4:104dd82c99b8, 2015-12-29 (annotated)
- Committer:
- shreeshas95
- Date:
- Tue Dec 29 06:50:19 2015 +0000
- Revision:
- 4:104dd82c99b8
- Child:
- 5:ab276a17ca07
Before making major modifications for testing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shreeshas95 | 4:104dd82c99b8 | 1 | #define COM_POWER_ON_TX {\ |
shreeshas95 | 4:104dd82c99b8 | 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 | 4:104dd82c99b8 | 5 | /*WARNING: INFINITE WHILE LOOP POSSIBLE*/\ |
shreeshas95 | 4:104dd82c99b8 | 6 | bool retryFlag = false;\ |
shreeshas95 | 4:104dd82c99b8 | 7 | while( retryFlag == true ){\ |
shreeshas95 | 4:104dd82c99b8 | 8 | uint8_t standbyAck = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 9 | /*PENDING: SET BEACON TO STANDBY*/\ |
shreeshas95 | 4:104dd82c99b8 | 10 | if( standbyAck == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 11 | /*PENDING: BEACON TX MAIN STATUS*/\ |
shreeshas95 | 4:104dd82c99b8 | 12 | if( true ){\ |
shreeshas95 | 4:104dd82c99b8 | 13 | retryFlag = false;\ |
shreeshas95 | 4:104dd82c99b8 | 14 | /*PENDING: SWITCH RELAY TO COM_TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 15 | /*PENDING: RF_SW_STATUS = RF_COM_TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 16 | }\ |
shreeshas95 | 4:104dd82c99b8 | 17 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 18 | gCOM_MNG_TMTC_THREAD->wait(5000);\ |
shreeshas95 | 4:104dd82c99b8 | 19 | }\ |
shreeshas95 | 4:104dd82c99b8 | 20 | }\ |
shreeshas95 | 4:104dd82c99b8 | 21 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 22 | /*PENDING: RESET BAE*/\ |
shreeshas95 | 4:104dd82c99b8 | 23 | uint8_t standbyAck2 = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 24 | /*PENDING: SET BEACON TO STANDBY*/\ |
shreeshas95 | 4:104dd82c99b8 | 25 | if( standbyAck2 == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 26 | /*PENDING: BEACON TX MAIN STAUTS*/\ |
shreeshas95 | 4:104dd82c99b8 | 27 | if( true ){\ |
shreeshas95 | 4:104dd82c99b8 | 28 | retryFlag = false;\ |
shreeshas95 | 4:104dd82c99b8 | 29 | /*PENDING: SWITCH RF RELAY TO COM TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 30 | /*PENDING: RF_SW_STATUS = RF_COM_TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 31 | }\ |
shreeshas95 | 4:104dd82c99b8 | 32 | }\ |
shreeshas95 | 4:104dd82c99b8 | 33 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 34 | retryFlag = false;\ |
shreeshas95 | 4:104dd82c99b8 | 35 | /*PENDING: POWER OFF BEACON*/\ |
shreeshas95 | 4:104dd82c99b8 | 36 | /*PENDING: CLEAR BAE SW_EN*/\ |
shreeshas95 | 4:104dd82c99b8 | 37 | /*PENDING: SWITCH RF RELAY TO COM TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 38 | /*PENDING: RF_SW_STATUS = RF_COM_TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 39 | }\ |
shreeshas95 | 4:104dd82c99b8 | 40 | }\ |
shreeshas95 | 4:104dd82c99b8 | 41 | }\ |
shreeshas95 | 4:104dd82c99b8 | 42 | }\ |
shreeshas95 | 4:104dd82c99b8 | 43 | /*PENDING: POWER ON COM_TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 44 | uint8_t adfConfigPass = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 45 | for( int i = 0 ; i < COM_TX_CONFIG_LIMIT ; ++i ){\ |
shreeshas95 | 4:104dd82c99b8 | 46 | /*PENDING: CONFIGURE ADF*/\ |
shreeshas95 | 4:104dd82c99b8 | 47 | if( adfConfigPass == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 48 | break;\ |
shreeshas95 | 4:104dd82c99b8 | 49 | }\ |
shreeshas95 | 4:104dd82c99b8 | 50 | }\ |
shreeshas95 | 4:104dd82c99b8 | 51 | if( adfConfigPass == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 52 | /*adf successfully configured*/\ |
shreeshas95 | 4:104dd82c99b8 | 53 | /*CALL SIGN*/\ |
shreeshas95 | 4:104dd82c99b8 | 54 | Base_tm *power_on_tm = NULL;\ |
shreeshas95 | 4:104dd82c99b8 | 55 | Base_tm *power_on_tm_head = NULL;\ |
shreeshas95 | 4:104dd82c99b8 | 56 | get_call_sign( power_on_tm_head );\ |
shreeshas95 | 4:104dd82c99b8 | 57 | power_on_tm = power_on_tm_head;\ |
shreeshas95 | 4:104dd82c99b8 | 58 | /*ACK L1*/\ |
shreeshas95 | 4:104dd82c99b8 | 59 | get_ack_l1(power_on_tm->next_TM);\ |
shreeshas95 | 4:104dd82c99b8 | 60 | int overFlowCountADF = 0;\ |
shreeshas95 | 4:104dd82c99b8 | 61 | while( power_on_tm->next_TM != NULL ){\ |
shreeshas95 | 4:104dd82c99b8 | 62 | if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\ |
shreeshas95 | 4:104dd82c99b8 | 63 | power_on_tm = power_on_tm->next_TM;\ |
shreeshas95 | 4:104dd82c99b8 | 64 | ++overFlowCountADF;\ |
shreeshas95 | 4:104dd82c99b8 | 65 | }\ |
shreeshas95 | 4:104dd82c99b8 | 66 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 67 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 68 | break;\ |
shreeshas95 | 4:104dd82c99b8 | 69 | }\ |
shreeshas95 | 4:104dd82c99b8 | 70 | }\ |
shreeshas95 | 4:104dd82c99b8 | 71 | get_tc_list(power_on_tm->next_TM, 0x00);\ |
shreeshas95 | 4:104dd82c99b8 | 72 | /*PENDING: TRANSMIT ABOVE TM*/\ |
shreeshas95 | 4:104dd82c99b8 | 73 | power_on_tm = power_on_tm_head;\ |
shreeshas95 | 4:104dd82c99b8 | 74 | overFlowCountADF = 0;\ |
shreeshas95 | 4:104dd82c99b8 | 75 | while( power_on_tm != NULL ){\ |
shreeshas95 | 4:104dd82c99b8 | 76 | if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\ |
shreeshas95 | 4:104dd82c99b8 | 77 | Base_tm *temp = power_on_tm->next_TM;\ |
shreeshas95 | 4:104dd82c99b8 | 78 | delete power_on_tm;\ |
shreeshas95 | 4:104dd82c99b8 | 79 | power_on_tm = temp;\ |
shreeshas95 | 4:104dd82c99b8 | 80 | ++overFlowCountADF;\ |
shreeshas95 | 4:104dd82c99b8 | 81 | }\ |
shreeshas95 | 4:104dd82c99b8 | 82 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 83 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 84 | break;\ |
shreeshas95 | 4:104dd82c99b8 | 85 | }\ |
shreeshas95 | 4:104dd82c99b8 | 86 | }\ |
shreeshas95 | 4:104dd82c99b8 | 87 | }\ |
shreeshas95 | 4:104dd82c99b8 | 88 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 89 | /*PENDING: COM_POWER OFF TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 90 | /*PENDING: CDMS HK MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 91 | uint8_t ackReceived = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 92 | /*PENDING: BCN TX MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 93 | if( ackReceived == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 94 | gCOM_MNG_TMTC_THREAD->wait(5000);\ |
shreeshas95 | 4:104dd82c99b8 | 95 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 96 | }\ |
shreeshas95 | 4:104dd82c99b8 | 97 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 98 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 99 | }\ |
shreeshas95 | 4:104dd82c99b8 | 100 | }\ |
shreeshas95 | 4:104dd82c99b8 | 101 | gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");\ |
shreeshas95 | 4:104dd82c99b8 | 102 | } |