![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Repo for COM_MNG_TMTC_SIMPLE for integration with adf
Fork of COM_MNG_TMTC_SIMPLE by
COM_RCV_TC.h@4:104dd82c99b8, 2015-12-29 (annotated)
- Committer:
- shreeshas95
- Date:
- Tue Dec 29 06:50:19 2015 +0000
- Revision:
- 4:104dd82c99b8
- Parent:
- 2:2caf2a9a13aa
- Child:
- 5:ab276a17ca07
Before making major modifications for testing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shreeshas95 | 0:f016e9e8d48b | 1 | #define flushData_appendTC(bytes, outState) {\ |
shreeshas95 | 0:f016e9e8d48b | 2 | uint16_t tc_type = 2;\ |
shreeshas95 | 0:f016e9e8d48b | 3 | if( (bytes == TC_SHORT_SIZE) && (outState == 7) ){\ |
shreeshas95 | 4:104dd82c99b8 | 4 | tc_type = SHORT_TC_CODE;\ |
shreeshas95 | 0:f016e9e8d48b | 5 | }\ |
shreeshas95 | 0:f016e9e8d48b | 6 | else if( (bytes == TC_LONG_SIZE) && (outState == 7) ){\ |
shreeshas95 | 4:104dd82c99b8 | 7 | tc_type = LONG_TC_CODE;\ |
shreeshas95 | 0:f016e9e8d48b | 8 | }\ |
shreeshas95 | 0:f016e9e8d48b | 9 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 10 | gPC.puts("incorrect size\r\n");\ |
shreeshas95 | 4:104dd82c99b8 | 11 | gPC.printf("%u, %u\r\n", bytes, outState);\ |
shreeshas95 | 2:2caf2a9a13aa | 12 | ++gTOTAL_INCORRECT_SIZE_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 13 | }\ |
shreeshas95 | 4:104dd82c99b8 | 14 | if( tc_type == SHORT_TC_CODE ){\ |
shreeshas95 | 0:f016e9e8d48b | 15 | uint16_t crc_checksum = crc16_gen(rx_tempString, TC_SHORT_SIZE-2);\ |
shreeshas95 | 0:f016e9e8d48b | 16 | if( ( (crc_checksum & 0xFF) == rx_tempString[TC_SHORT_SIZE-1]) && ( ((crc_checksum >> 8) & 0xFF) == rx_tempString[TC_SHORT_SIZE-2] ) ){\ |
shreeshas95 | 0:f016e9e8d48b | 17 | uint16_t temp16;\ |
shreeshas95 | 0:f016e9e8d48b | 18 | Base_tc *temp_ptr = gHEAD_NODE_TCL;\ |
shreeshas95 | 0:f016e9e8d48b | 19 | bool repeat_flag = false;\ |
shreeshas95 | 0:f016e9e8d48b | 20 | uint8_t testPSC = rx_tempString[0];\ |
shreeshas95 | 0:f016e9e8d48b | 21 | while(temp_ptr != NULL){\ |
shreeshas95 | 0:f016e9e8d48b | 22 | if( GETpacket_seq_count(temp_ptr) == testPSC ){\ |
shreeshas95 | 0:f016e9e8d48b | 23 | repeat_flag = true;\ |
shreeshas95 | 0:f016e9e8d48b | 24 | break;\ |
shreeshas95 | 0:f016e9e8d48b | 25 | }\ |
shreeshas95 | 0:f016e9e8d48b | 26 | temp_ptr = temp_ptr->next_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 27 | }\ |
shreeshas95 | 0:f016e9e8d48b | 28 | if( repeat_flag == false ){\ |
shreeshas95 | 4:104dd82c99b8 | 29 | gPC.puts("Found short tc\e\n");\ |
shreeshas95 | 0:f016e9e8d48b | 30 | if( rx_tc_frames == 0 ){\ |
shreeshas95 | 0:f016e9e8d48b | 31 | gHEAD_NODE_TCL = new Short_tc;\ |
shreeshas95 | 0:f016e9e8d48b | 32 | gHEAD_NODE_TCL->next_TC = NULL;\ |
shreeshas95 | 0:f016e9e8d48b | 33 | gLAST_NODE_TCL = gHEAD_NODE_TCL;\ |
shreeshas95 | 0:f016e9e8d48b | 34 | }\ |
shreeshas95 | 0:f016e9e8d48b | 35 | else{\ |
shreeshas95 | 0:f016e9e8d48b | 36 | gLAST_NODE_TCL->next_TC = new Short_tc;\ |
shreeshas95 | 4:104dd82c99b8 | 37 | gLAST_NODE_TCL = gLAST_NODE_TCL->next_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 38 | gLAST_NODE_TCL->next_TC = NULL;\ |
shreeshas95 | 0:f016e9e8d48b | 39 | }\ |
shreeshas95 | 4:104dd82c99b8 | 40 | gPC.puts("printing tx string\r\n");\ |
shreeshas95 | 0:f016e9e8d48b | 41 | for(int i = 0 ; i < TC_SHORT_SIZE ; ++i){\ |
shreeshas95 | 0:f016e9e8d48b | 42 | gLAST_NODE_TCL->TC_string[i] = rx_tempString[i];\ |
shreeshas95 | 4:104dd82c99b8 | 43 | gPC.printf("%x ", gLAST_NODE_TCL->TC_string[i]);\ |
shreeshas95 | 0:f016e9e8d48b | 44 | }\ |
shreeshas95 | 0:f016e9e8d48b | 45 | PUTshort_or_long(gLAST_NODE_TCL, tc_type);\ |
shreeshas95 | 0:f016e9e8d48b | 46 | temp16 = 1;\ |
shreeshas95 | 0:f016e9e8d48b | 47 | PUTcrc_pass(gLAST_NODE_TCL, temp16);\ |
shreeshas95 | 0:f016e9e8d48b | 48 | temp16 = 0;\ |
shreeshas95 | 0:f016e9e8d48b | 49 | PUTexec_status(gLAST_NODE_TCL, temp16);\ |
shreeshas95 | 0:f016e9e8d48b | 50 | ++gTOTAL_VALID_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 51 | }\ |
shreeshas95 | 2:2caf2a9a13aa | 52 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 53 | gPC.puts("repeated psc short\r\n");\ |
shreeshas95 | 2:2caf2a9a13aa | 54 | ++gTOTAL_REPEATED_TC;\ |
shreeshas95 | 2:2caf2a9a13aa | 55 | }\ |
shreeshas95 | 0:f016e9e8d48b | 56 | }\ |
shreeshas95 | 0:f016e9e8d48b | 57 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 58 | gPC.puts("crc fail tc short");\ |
shreeshas95 | 0:f016e9e8d48b | 59 | ++gTOTAL_CRC_FAIL_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 60 | }\ |
shreeshas95 | 0:f016e9e8d48b | 61 | }\ |
shreeshas95 | 4:104dd82c99b8 | 62 | else if( tc_type == LONG_TC_CODE ){\ |
shreeshas95 | 0:f016e9e8d48b | 63 | uint16_t crc_checksum = crc16_gen(rx_tempString, TC_LONG_SIZE-2);\ |
shreeshas95 | 0:f016e9e8d48b | 64 | if( ( (crc_checksum & 0xFF) == rx_tempString[TC_LONG_SIZE-1]) && ( ((crc_checksum >> 8) & 0xFF) == rx_tempString[TC_LONG_SIZE-2] ) ){\ |
shreeshas95 | 0:f016e9e8d48b | 65 | uint16_t temp16;\ |
shreeshas95 | 0:f016e9e8d48b | 66 | Base_tc *temp_ptr = gHEAD_NODE_TCL;\ |
shreeshas95 | 0:f016e9e8d48b | 67 | bool repeat_flag = false;\ |
shreeshas95 | 0:f016e9e8d48b | 68 | uint8_t testPSC = rx_tempString[0];\ |
shreeshas95 | 0:f016e9e8d48b | 69 | while(temp_ptr != NULL){\ |
shreeshas95 | 0:f016e9e8d48b | 70 | if( GETpacket_seq_count(temp_ptr) == testPSC ){\ |
shreeshas95 | 0:f016e9e8d48b | 71 | repeat_flag = true;\ |
shreeshas95 | 0:f016e9e8d48b | 72 | break;\ |
shreeshas95 | 0:f016e9e8d48b | 73 | }\ |
shreeshas95 | 0:f016e9e8d48b | 74 | temp_ptr = temp_ptr->next_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 75 | }\ |
shreeshas95 | 0:f016e9e8d48b | 76 | if( repeat_flag == false ){\ |
shreeshas95 | 4:104dd82c99b8 | 77 | gPC.puts("Found lling tc\e\n");\ |
shreeshas95 | 0:f016e9e8d48b | 78 | if( rx_tc_frames == 0 ){\ |
shreeshas95 | 0:f016e9e8d48b | 79 | gHEAD_NODE_TCL = new Long_tc;\ |
shreeshas95 | 0:f016e9e8d48b | 80 | gHEAD_NODE_TCL->next_TC = NULL;\ |
shreeshas95 | 0:f016e9e8d48b | 81 | gLAST_NODE_TCL = gHEAD_NODE_TCL;\ |
shreeshas95 | 0:f016e9e8d48b | 82 | }\ |
shreeshas95 | 0:f016e9e8d48b | 83 | else{\ |
shreeshas95 | 0:f016e9e8d48b | 84 | gLAST_NODE_TCL->next_TC = new Long_tc;\ |
shreeshas95 | 0:f016e9e8d48b | 85 | gLAST_NODE_TCL = gLAST_NODE_TCL->next_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 86 | gLAST_NODE_TCL->next_TC = NULL;\ |
shreeshas95 | 0:f016e9e8d48b | 87 | }\ |
shreeshas95 | 0:f016e9e8d48b | 88 | for(int i = 0 ; i < TC_LONG_SIZE ; ++i){\ |
shreeshas95 | 0:f016e9e8d48b | 89 | gLAST_NODE_TCL->TC_string[i] = rx_tempString[i];\ |
shreeshas95 | 4:104dd82c99b8 | 90 | gPC.printf("%x ", gLAST_NODE_TCL->TC_string[i]);\ |
shreeshas95 | 0:f016e9e8d48b | 91 | }\ |
shreeshas95 | 0:f016e9e8d48b | 92 | PUTshort_or_long(gLAST_NODE_TCL, tc_type);\ |
shreeshas95 | 0:f016e9e8d48b | 93 | temp16 = 1;\ |
shreeshas95 | 0:f016e9e8d48b | 94 | PUTcrc_pass(gLAST_NODE_TCL, temp16);\ |
shreeshas95 | 0:f016e9e8d48b | 95 | temp16 = 0;\ |
shreeshas95 | 0:f016e9e8d48b | 96 | PUTexec_status(gLAST_NODE_TCL, temp16);\ |
shreeshas95 | 0:f016e9e8d48b | 97 | ++gTOTAL_VALID_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 98 | }\ |
shreeshas95 | 2:2caf2a9a13aa | 99 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 100 | gPC.puts("repeated psc long\r\n");\ |
shreeshas95 | 2:2caf2a9a13aa | 101 | ++gTOTAL_REPEATED_TC;\ |
shreeshas95 | 2:2caf2a9a13aa | 102 | }\ |
shreeshas95 | 0:f016e9e8d48b | 103 | }\ |
shreeshas95 | 0:f016e9e8d48b | 104 | else{\ |
shreeshas95 | 4:104dd82c99b8 | 105 | gPC.puts("crc fail tc long");\ |
shreeshas95 | 0:f016e9e8d48b | 106 | ++gTOTAL_CRC_FAIL_TC;\ |
shreeshas95 | 0:f016e9e8d48b | 107 | }\ |
shreeshas95 | 0:f016e9e8d48b | 108 | }\ |
shreeshas95 | 0:f016e9e8d48b | 109 | ++rx_tc_frames;\ |
shreeshas95 | 0:f016e9e8d48b | 110 | } |
shreeshas95 | 0:f016e9e8d48b | 111 | |
shreeshas95 | 0:f016e9e8d48b | 112 | unsigned int rx_tc_frames = 0; |
shreeshas95 | 0:f016e9e8d48b | 113 | unsigned char rx_tempString[TC_LONG_SIZE+1]; |
shreeshas95 | 0:f016e9e8d48b | 114 | |
shreeshas95 | 0:f016e9e8d48b | 115 | void raw_data_to_tc(void){ |
shreeshas95 | 4:104dd82c99b8 | 116 | gPC.puts("inside raw_data_to_tc\r\n"); |
shreeshas95 | 0:f016e9e8d48b | 117 | bool frame_started = false; |
shreeshas95 | 0:f016e9e8d48b | 118 | bool chain_started = false; |
shreeshas95 | 0:f016e9e8d48b | 119 | bool flush_called = false; |
shreeshas95 | 0:f016e9e8d48b | 120 | |
shreeshas95 | 0:f016e9e8d48b | 121 | uint32_t bytes_read = 0; |
shreeshas95 | 0:f016e9e8d48b | 122 | uint8_t state7e = 0; |
shreeshas95 | 0:f016e9e8d48b | 123 | uint8_t outState = 0; |
shreeshas95 | 0:f016e9e8d48b | 124 | uint32_t outByte = 0; |
shreeshas95 | 0:f016e9e8d48b | 125 | uint32_t byteCount = 0; |
shreeshas95 | 2:2caf2a9a13aa | 126 | |
shreeshas95 | 2:2caf2a9a13aa | 127 | gTOTAL_VALID_TC = 0; |
shreeshas95 | 0:f016e9e8d48b | 128 | |
shreeshas95 | 0:f016e9e8d48b | 129 | COM_RX_DATA_NODE *data_node = gRX_HEAD_DATA_NODE; |
shreeshas95 | 0:f016e9e8d48b | 130 | // read byte by byte |
shreeshas95 | 0:f016e9e8d48b | 131 | while( data_node != NULL ){ |
shreeshas95 | 0:f016e9e8d48b | 132 | for(int iBuf = 0 ; iBuf < RX_BUFFER_LENGTH ; ++iBuf ){ |
shreeshas95 | 0:f016e9e8d48b | 133 | uint8_t test_this = data_node->values[iBuf]; |
shreeshas95 | 0:f016e9e8d48b | 134 | ++bytes_read; |
shreeshas95 | 0:f016e9e8d48b | 135 | |
shreeshas95 | 0:f016e9e8d48b | 136 | // read bit by bit |
shreeshas95 | 0:f016e9e8d48b | 137 | for(int i = 7 ; i >= 0 ; --i){ |
shreeshas95 | 0:f016e9e8d48b | 138 | unsigned char tempBit = (test_this >> i) & 1; |
shreeshas95 | 0:f016e9e8d48b | 139 | bool skipIteration = false; |
shreeshas95 | 0:f016e9e8d48b | 140 | |
shreeshas95 | 0:f016e9e8d48b | 141 | if( tempBit == 1 ){ |
shreeshas95 | 0:f016e9e8d48b | 142 | switch( state7e ){ |
shreeshas95 | 0:f016e9e8d48b | 143 | case 0: |
shreeshas95 | 0:f016e9e8d48b | 144 | state7e = 0; |
shreeshas95 | 0:f016e9e8d48b | 145 | break; |
shreeshas95 | 0:f016e9e8d48b | 146 | case 1: |
shreeshas95 | 0:f016e9e8d48b | 147 | state7e = 2; |
shreeshas95 | 0:f016e9e8d48b | 148 | break; |
shreeshas95 | 0:f016e9e8d48b | 149 | case 2: |
shreeshas95 | 0:f016e9e8d48b | 150 | state7e = 3; |
shreeshas95 | 0:f016e9e8d48b | 151 | break; |
shreeshas95 | 0:f016e9e8d48b | 152 | case 3: |
shreeshas95 | 0:f016e9e8d48b | 153 | state7e = 4; |
shreeshas95 | 0:f016e9e8d48b | 154 | break; |
shreeshas95 | 0:f016e9e8d48b | 155 | case 4: |
shreeshas95 | 0:f016e9e8d48b | 156 | state7e = 5; |
shreeshas95 | 0:f016e9e8d48b | 157 | break; |
shreeshas95 | 0:f016e9e8d48b | 158 | case 5: |
shreeshas95 | 0:f016e9e8d48b | 159 | state7e = 6; |
shreeshas95 | 0:f016e9e8d48b | 160 | break; |
shreeshas95 | 0:f016e9e8d48b | 161 | case 6: |
shreeshas95 | 0:f016e9e8d48b | 162 | state7e = 7; |
shreeshas95 | 0:f016e9e8d48b | 163 | break; |
shreeshas95 | 0:f016e9e8d48b | 164 | case 7: |
shreeshas95 | 0:f016e9e8d48b | 165 | // error reset |
shreeshas95 | 0:f016e9e8d48b | 166 | state7e = 0; |
shreeshas95 | 0:f016e9e8d48b | 167 | chain_started = false; |
shreeshas95 | 0:f016e9e8d48b | 168 | frame_started = false; |
shreeshas95 | 0:f016e9e8d48b | 169 | byteCount = 0; |
shreeshas95 | 0:f016e9e8d48b | 170 | outByte = 0; |
shreeshas95 | 0:f016e9e8d48b | 171 | outState = 0; |
shreeshas95 | 0:f016e9e8d48b | 172 | skipIteration = true; |
shreeshas95 | 0:f016e9e8d48b | 173 | break; |
shreeshas95 | 0:f016e9e8d48b | 174 | } |
shreeshas95 | 0:f016e9e8d48b | 175 | } |
shreeshas95 | 0:f016e9e8d48b | 176 | else{ |
shreeshas95 | 0:f016e9e8d48b | 177 | switch( state7e ){ |
shreeshas95 | 0:f016e9e8d48b | 178 | case 0: |
shreeshas95 | 0:f016e9e8d48b | 179 | case 1: |
shreeshas95 | 0:f016e9e8d48b | 180 | case 2: |
shreeshas95 | 0:f016e9e8d48b | 181 | case 3: |
shreeshas95 | 0:f016e9e8d48b | 182 | case 4: |
shreeshas95 | 0:f016e9e8d48b | 183 | case 5: |
shreeshas95 | 0:f016e9e8d48b | 184 | state7e = 1; |
shreeshas95 | 0:f016e9e8d48b | 185 | break; |
shreeshas95 | 0:f016e9e8d48b | 186 | case 6: |
shreeshas95 | 0:f016e9e8d48b | 187 | state7e = 1; |
shreeshas95 | 0:f016e9e8d48b | 188 | skipIteration = true; |
shreeshas95 | 0:f016e9e8d48b | 189 | break; |
shreeshas95 | 0:f016e9e8d48b | 190 | case 7: |
shreeshas95 | 0:f016e9e8d48b | 191 | state7e = 0; |
shreeshas95 | 0:f016e9e8d48b | 192 | // detected 7e |
shreeshas95 | 0:f016e9e8d48b | 193 | if( !chain_started ){ |
shreeshas95 | 0:f016e9e8d48b | 194 | chain_started = true; |
shreeshas95 | 0:f016e9e8d48b | 195 | frame_started = true; |
shreeshas95 | 0:f016e9e8d48b | 196 | byteCount = 0; |
shreeshas95 | 0:f016e9e8d48b | 197 | outByte = 0; |
shreeshas95 | 0:f016e9e8d48b | 198 | outState = 0; |
shreeshas95 | 0:f016e9e8d48b | 199 | skipIteration = true; |
shreeshas95 | 0:f016e9e8d48b | 200 | } |
shreeshas95 | 0:f016e9e8d48b | 201 | else{ |
shreeshas95 | 0:f016e9e8d48b | 202 | flush_called = true; |
shreeshas95 | 0:f016e9e8d48b | 203 | flushData_appendTC(byteCount, outState); |
shreeshas95 | 0:f016e9e8d48b | 204 | byteCount = 0; |
shreeshas95 | 0:f016e9e8d48b | 205 | outState = 0; |
shreeshas95 | 0:f016e9e8d48b | 206 | outByte = 0; |
shreeshas95 | 0:f016e9e8d48b | 207 | skipIteration = true; |
shreeshas95 | 0:f016e9e8d48b | 208 | } |
shreeshas95 | 0:f016e9e8d48b | 209 | break; |
shreeshas95 | 0:f016e9e8d48b | 210 | } |
shreeshas95 | 0:f016e9e8d48b | 211 | } |
shreeshas95 | 0:f016e9e8d48b | 212 | if( (!skipIteration) && (frame_started) ){ |
shreeshas95 | 0:f016e9e8d48b | 213 | // write bit to output |
shreeshas95 | 0:f016e9e8d48b | 214 | switch( outState ){ |
shreeshas95 | 0:f016e9e8d48b | 215 | case 0: |
shreeshas95 | 0:f016e9e8d48b | 216 | outState = 1; |
shreeshas95 | 0:f016e9e8d48b | 217 | rx_tempString[outByte] = tempBit << 7; |
shreeshas95 | 0:f016e9e8d48b | 218 | break; |
shreeshas95 | 0:f016e9e8d48b | 219 | case 1: |
shreeshas95 | 0:f016e9e8d48b | 220 | outState = 2; |
shreeshas95 | 0:f016e9e8d48b | 221 | rx_tempString[outByte] += tempBit << 6; |
shreeshas95 | 0:f016e9e8d48b | 222 | break; |
shreeshas95 | 0:f016e9e8d48b | 223 | case 2: |
shreeshas95 | 0:f016e9e8d48b | 224 | outState = 3; |
shreeshas95 | 0:f016e9e8d48b | 225 | rx_tempString[outByte] += tempBit << 5; |
shreeshas95 | 0:f016e9e8d48b | 226 | break; |
shreeshas95 | 0:f016e9e8d48b | 227 | case 3: |
shreeshas95 | 0:f016e9e8d48b | 228 | outState = 4; |
shreeshas95 | 0:f016e9e8d48b | 229 | rx_tempString[outByte] += tempBit << 4; |
shreeshas95 | 0:f016e9e8d48b | 230 | break; |
shreeshas95 | 0:f016e9e8d48b | 231 | case 4: |
shreeshas95 | 0:f016e9e8d48b | 232 | outState = 5; |
shreeshas95 | 0:f016e9e8d48b | 233 | rx_tempString[outByte] += tempBit << 3; |
shreeshas95 | 0:f016e9e8d48b | 234 | break; |
shreeshas95 | 0:f016e9e8d48b | 235 | case 5: |
shreeshas95 | 0:f016e9e8d48b | 236 | outState = 6; |
shreeshas95 | 0:f016e9e8d48b | 237 | rx_tempString[outByte] += tempBit << 2; |
shreeshas95 | 0:f016e9e8d48b | 238 | break; |
shreeshas95 | 0:f016e9e8d48b | 239 | case 6: |
shreeshas95 | 0:f016e9e8d48b | 240 | outState = 7; |
shreeshas95 | 0:f016e9e8d48b | 241 | rx_tempString[outByte] += tempBit << 1; |
shreeshas95 | 0:f016e9e8d48b | 242 | break; |
shreeshas95 | 0:f016e9e8d48b | 243 | case 7: |
shreeshas95 | 0:f016e9e8d48b | 244 | outState = 0; |
shreeshas95 | 0:f016e9e8d48b | 245 | rx_tempString[outByte] += tempBit; |
shreeshas95 | 0:f016e9e8d48b | 246 | ++outByte; |
shreeshas95 | 0:f016e9e8d48b | 247 | // exceeded tc length discard |
shreeshas95 | 0:f016e9e8d48b | 248 | if(outByte > 135){ |
shreeshas95 | 2:2caf2a9a13aa | 249 | ++gTOTAL_INCORRECT_SIZE_TC; |
shreeshas95 | 0:f016e9e8d48b | 250 | outByte = 0; |
shreeshas95 | 0:f016e9e8d48b | 251 | } |
shreeshas95 | 0:f016e9e8d48b | 252 | ++byteCount; |
shreeshas95 | 0:f016e9e8d48b | 253 | break; |
shreeshas95 | 0:f016e9e8d48b | 254 | } |
shreeshas95 | 0:f016e9e8d48b | 255 | } |
shreeshas95 | 0:f016e9e8d48b | 256 | } |
shreeshas95 | 0:f016e9e8d48b | 257 | } |
shreeshas95 | 0:f016e9e8d48b | 258 | COM_RX_DATA_NODE *temp = data_node->next_node; |
shreeshas95 | 0:f016e9e8d48b | 259 | delete data_node; |
shreeshas95 | 0:f016e9e8d48b | 260 | data_node = temp; |
shreeshas95 | 0:f016e9e8d48b | 261 | } |
shreeshas95 | 0:f016e9e8d48b | 262 | if( (!flush_called) && (gTOTAL_INCORRECT_SIZE_TC == 0) ){ |
shreeshas95 | 0:f016e9e8d48b | 263 | ++gTOTAL_INCORRECT_SIZE_TC; |
shreeshas95 | 0:f016e9e8d48b | 264 | } |
shreeshas95 | 0:f016e9e8d48b | 265 | gRX_HEAD_DATA_NODE = new COM_RX_DATA_NODE; |
shreeshas95 | 0:f016e9e8d48b | 266 | gRX_HEAD_DATA_NODE->next_node = NULL; |
shreeshas95 | 0:f016e9e8d48b | 267 | gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE; |
shreeshas95 | 2:2caf2a9a13aa | 268 | gRX_COUNT = 0; |
shreeshas95 | 0:f016e9e8d48b | 269 | |
shreeshas95 | 4:104dd82c99b8 | 270 | gPC.puts("Completed conversion of raw_data\r\n"); |
shreeshas95 | 0:f016e9e8d48b | 271 | // PENDING: SORT THE LINKED LIST ACCORDING TO PSC VALUE |
shreeshas95 | 0:f016e9e8d48b | 272 | } |