![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
CDMS_CODE_samp_23SEP_DMA_flag
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE_samp_23SEP_DMA by
COM_POWER_ON_TX.h@55:39e59903bc3a, 2016-01-14 (annotated)
- Committer:
- ee12b079
- Date:
- Thu Jan 14 15:00:25 2016 +0000
- Revision:
- 55:39e59903bc3a
- Parent:
- 23:c89376564196
Incomplete, use revision 53 for integrating or testing
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 | 15:1c1ca992b43b | 73 | power_on_tm = power_on_tm_head;\ |
shreeshas95 | 15:1c1ca992b43b | 74 | while(power_on_tm != NULL){\ |
shreeshas95 | 15:1c1ca992b43b | 75 | int length = TM_SHORT_SIZE;\ |
shreeshas95 | 15:1c1ca992b43b | 76 | if( GETshort_or_long_tm(power_on_tm->fields) == SHORT_TM_CODE ){\ |
shreeshas95 | 15:1c1ca992b43b | 77 | length = TM_SHORT_SIZE;\ |
shreeshas95 | 15:1c1ca992b43b | 78 | }\ |
shreeshas95 | 15:1c1ca992b43b | 79 | else{\ |
shreeshas95 | 15:1c1ca992b43b | 80 | length = TM_LONG_SIZE;\ |
shreeshas95 | 15:1c1ca992b43b | 81 | }\ |
rohit3342 | 23:c89376564196 | 82 | /*gPC.puts("Printing Call Sign, ACK_L1, TC_LIST inside COM_POWER_ON\r\n");*/\ |
shreeshas95 | 15:1c1ca992b43b | 83 | for(int i = 0 ; i < length ; ++i){\ |
ee12b079 | 55:39e59903bc3a | 84 | /*gPC.putc(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 | }\ |
shreeshas95 | 4:104dd82c99b8 | 88 | /*PENDING: TRANSMIT ABOVE TM*/\ |
shreeshas95 | 5:ab276a17ca07 | 89 | /*deleting the telemetry*/\ |
shreeshas95 | 4:104dd82c99b8 | 90 | power_on_tm = power_on_tm_head;\ |
shreeshas95 | 4:104dd82c99b8 | 91 | overFlowCountADF = 0;\ |
shreeshas95 | 4:104dd82c99b8 | 92 | while( power_on_tm != NULL ){\ |
shreeshas95 | 4:104dd82c99b8 | 93 | if( overFlowCountADF < TM_OVERFLOW_CONSTANT ){\ |
shreeshas95 | 4:104dd82c99b8 | 94 | Base_tm *temp = power_on_tm->next_TM;\ |
shreeshas95 | 4:104dd82c99b8 | 95 | delete power_on_tm;\ |
shreeshas95 | 4:104dd82c99b8 | 96 | power_on_tm = temp;\ |
shreeshas95 | 4:104dd82c99b8 | 97 | ++overFlowCountADF;\ |
shreeshas95 | 4:104dd82c99b8 | 98 | }\ |
shreeshas95 | 4:104dd82c99b8 | 99 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 100 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 101 | break;\ |
shreeshas95 | 4:104dd82c99b8 | 102 | }\ |
shreeshas95 | 4:104dd82c99b8 | 103 | }\ |
shreeshas95 | 4:104dd82c99b8 | 104 | }\ |
shreeshas95 | 4:104dd82c99b8 | 105 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 106 | /*PENDING: COM_POWER OFF TX*/\ |
shreeshas95 | 4:104dd82c99b8 | 107 | /*PENDING: CDMS HK MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 108 | uint8_t ackReceived = 0x00;\ |
shreeshas95 | 4:104dd82c99b8 | 109 | /*PENDING: BCN TX MAIN*/\ |
shreeshas95 | 4:104dd82c99b8 | 110 | if( ackReceived == 0xFF ){\ |
shreeshas95 | 4:104dd82c99b8 | 111 | gCOM_MNG_TMTC_THREAD->wait(5000);\ |
shreeshas95 | 4:104dd82c99b8 | 112 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 113 | }\ |
shreeshas95 | 4:104dd82c99b8 | 114 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 115 | /*PENDING: RESET CDMS*/\ |
shreeshas95 | 4:104dd82c99b8 | 116 | }\ |
shreeshas95 | 4:104dd82c99b8 | 117 | }\ |
aniruddhv | 12:ffdb29353058 | 118 | /*gPC.puts("COMPLETED COM_POWER_ON_TX\r\n");*/\ |
shreeshas95 | 4:104dd82c99b8 | 119 | } |