Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Diff: COM_RCV_TC.h
- Revision:
- 5:ab276a17ca07
- Parent:
- 4:104dd82c99b8
- Child:
- 12:ffdb29353058
--- a/COM_RCV_TC.h Tue Dec 29 06:50:19 2015 +0000 +++ b/COM_RCV_TC.h Wed Dec 30 06:36:38 2015 +0000 @@ -7,8 +7,8 @@ tc_type = LONG_TC_CODE;\ }\ else{\ - gPC.puts("incorrect size\r\n");\ - gPC.printf("%u, %u\r\n", bytes, outState);\ + /*gPC.puts("incorrect size\r\n");*/\ + /*gPC.printf("%u, %u\r\n", bytes, outState);*/\ ++gTOTAL_INCORRECT_SIZE_TC;\ }\ if( tc_type == SHORT_TC_CODE ){\ @@ -26,8 +26,7 @@ temp_ptr = temp_ptr->next_TC;\ }\ if( repeat_flag == false ){\ - gPC.puts("Found short tc\e\n");\ - if( rx_tc_frames == 0 ){\ + if( gTOTAL_VALID_TC == 0 ){\ gHEAD_NODE_TCL = new Short_tc;\ gHEAD_NODE_TCL->next_TC = NULL;\ gLAST_NODE_TCL = gHEAD_NODE_TCL;\ @@ -37,10 +36,9 @@ gLAST_NODE_TCL = gLAST_NODE_TCL->next_TC;\ gLAST_NODE_TCL->next_TC = NULL;\ }\ - gPC.puts("printing tx string\r\n");\ + /*gPC.puts("printing tx string\r\n");*/\ for(int i = 0 ; i < TC_SHORT_SIZE ; ++i){\ gLAST_NODE_TCL->TC_string[i] = rx_tempString[i];\ - gPC.printf("%x ", gLAST_NODE_TCL->TC_string[i]);\ }\ PUTshort_or_long(gLAST_NODE_TCL, tc_type);\ temp16 = 1;\ @@ -55,7 +53,7 @@ }\ }\ else{\ - gPC.puts("crc fail tc short");\ + gPC.puts("crc fail tc short\r\n");\ ++gTOTAL_CRC_FAIL_TC;\ }\ }\ @@ -74,8 +72,7 @@ temp_ptr = temp_ptr->next_TC;\ }\ if( repeat_flag == false ){\ - gPC.puts("Found lling tc\e\n");\ - if( rx_tc_frames == 0 ){\ + if( gTOTAL_VALID_TC == 0 ){\ gHEAD_NODE_TCL = new Long_tc;\ gHEAD_NODE_TCL->next_TC = NULL;\ gLAST_NODE_TCL = gHEAD_NODE_TCL;\ @@ -85,9 +82,9 @@ gLAST_NODE_TCL = gLAST_NODE_TCL->next_TC;\ gLAST_NODE_TCL->next_TC = NULL;\ }\ + /*gPC.puts("printing tx string\r\n");*/\ for(int i = 0 ; i < TC_LONG_SIZE ; ++i){\ gLAST_NODE_TCL->TC_string[i] = rx_tempString[i];\ - gPC.printf("%x ", gLAST_NODE_TCL->TC_string[i]);\ }\ PUTshort_or_long(gLAST_NODE_TCL, tc_type);\ temp16 = 1;\ @@ -102,14 +99,12 @@ }\ }\ else{\ - gPC.puts("crc fail tc long");\ + gPC.puts("crc fail tc long\r\n");\ ++gTOTAL_CRC_FAIL_TC;\ }\ }\ - ++rx_tc_frames;\ } -unsigned int rx_tc_frames = 0; unsigned char rx_tempString[TC_LONG_SIZE+1]; void raw_data_to_tc(void){ @@ -124,8 +119,6 @@ uint32_t outByte = 0; uint32_t byteCount = 0; - gTOTAL_VALID_TC = 0; - COM_RX_DATA_NODE *data_node = gRX_HEAD_DATA_NODE; // read byte by byte while( data_node != NULL ){