June 30
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
COM_POWER_ON_TX.h@69:20f09a0c3fd2, 2016-01-17 (annotated)
- Committer:
- aniruddhv
- Date:
- Sun Jan 17 14:04:08 2016 +0000
- Revision:
- 69:20f09a0c3fd2
- Parent:
- 23:c89376564196
- Child:
- 89:cca875337dd5
Integrated shubham's changes
Who changed what in which revision?
User | Revision | Line number | New 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*/\ |
aniruddhv | 69:20f09a0c3fd2 | 74 | /*Call Sign, ACK_L1, TC_LIST*/\ |
aniruddhv | 69:20f09a0c3fd2 | 75 | snd_tm.head_pointer(power_on_tm_head);\ |
aniruddhv | 69:20f09a0c3fd2 | 76 | adf_not_SDcard;\ |
shreeshas95 | 5:ab276a17ca07 | 77 | /*deleting the telemetry*/\ |
shreeshas95 | 4:104dd82c99b8 | 78 | power_on_tm = power_on_tm_head;\ |
shreeshas95 | 4:104dd82c99b8 | 79 | overFlowCountADF = 0;\ |
shreeshas95 | 4:104dd82c99b8 | 80 | while( power_on_tm != NULL ){\ |
shreeshas95 | 4:104dd82c99b8 | 81 | if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\ |
shreeshas95 | 4:104dd82c99b8 | 82 | Base_tm *temp = power_on_tm->next_TM;\ |
shreeshas95 | 4:104dd82c99b8 | 83 | delete power_on_tm;\ |
shreeshas95 | 4:104dd82c99b8 | 84 | power_on_tm = temp;\ |
shreeshas95 | 4:104dd82c99b8 | 85 | ++overFlowCountADF;\ |
shreeshas95 | 4:104dd82c99b8 | 86 | }\ |
shreeshas95 | 4:104dd82c99b8 | 87 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 88 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 89 | break;\ |
shreeshas95 | 4:104dd82c99b8 | 90 | }\ |
shreeshas95 | 4:104dd82c99b8 | 91 | }\ |
shreeshas95 | 4:104dd82c99b8 | 92 | }\ |
shreeshas95 | 4:104dd82c99b8 | 93 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 94 | /*PENDING: COM_POWER OFF TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 95 | /*PENDING: CDMS HK MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 96 | uint8_t ackReceived = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 97 | /*PENDING: BCN TX MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 98 | if( ackReceived == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 99 | gCOM_MNG_TMTC_THREAD->wait(5000);\ |
shreeshas95 | 4:104dd82c99b8 | 100 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 101 | }\ |
shreeshas95 | 4:104dd82c99b8 | 102 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 103 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 104 | }\ |
shreeshas95 | 4:104dd82c99b8 | 105 | }\ |
aniruddhv | 12:ffdb29353058 | 106 | /*gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");*/\ |
shreeshas95 | 4:104dd82c99b8 | 107 | } |