
Compression code changed and RLY_TMTC pointers managed
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: ThreadsAndFunctions.h
- Revision:
- 12:ffdb29353058
- Parent:
- 6:79d422d1ed42
- Child:
- 16:538de1b20b3a
--- a/ThreadsAndFunctions.h Thu Dec 31 10:27:56 2015 +0000 +++ b/ThreadsAndFunctions.h Thu Dec 31 11:49:42 2015 +0000 @@ -23,7 +23,7 @@ #define reset_all {\ Base_tc *tcp = gHEAD_NODE_TCL;\ - gPC.puts("inside reset\r\n");\ + /*gPC.puts("inside reset\r\n");*/\ gFLAGS = 0x0000;\ while(tcp != NULL){\ Base_tc *temp = tcp->next_TC;\ @@ -52,7 +52,7 @@ gRX_CURRENT_DATA_NODE = gRX_HEAD_DATA_NODE;\ gRX_COUNT = 0;\ /*PENDING : ALL GLOBAL VAARIABLES AND FLAGS*/\ - gPC.puts("finished reset all\r\n");\ + /*gPC.puts("finished reset all\r\n");*/\ } #define PUT_RAW_BYTE {\ @@ -102,7 +102,7 @@ } } else if( gFLAGS & NEW_TC_RECEIVED ){ - gPC.puts("NEW TC RECEIVED\r\n"); + /*gPC.puts("NEW TC RECEIVED\r\n");*/ gFLAGS = gFLAGS & (~NEW_TC_RECEIVED); gFLAGS = gFLAGS | COM_MNG_TMTC_RUNNING_FLAG; @@ -119,20 +119,20 @@ gFLAGS = gFLAGS & (~COM_RX_FLAG); if( gTOTAL_VALID_TC > 0 ){ - gPC.printf("valid TC rx: %u\r\n", gTOTAL_VALID_TC); + /*gPC.printf("valid TC rx: %u\r\n", gTOTAL_VALID_TC);*/ if( gTOTAL_VALID_TC < COM_MAX_TC_LIMIT ){ // CHECK WEATHER TC LIST HAS MISSING TC OR WEATHER LAST FRAME BIT IS HIGH IN THE LAST PSC-TC - gPC.puts("checking for tc list complete\r\n"); + /*gPC.puts("checking for tc list complete\r\n");*/ uint8_t tempContinue = 0xFF; continueToExecute(tempContinue); if(tempContinue == 0x00){ - gPC.puts("tc list is complete\r\n"); + /*gPC.puts("tc list is complete\r\n");*/ // CHECK WEATHER GS VERIFICATION CODE MATCHES uint8_t tempGSver = 0x00; GScodeVerification(tempGSver); /*PENDING: INCLUDE GS VERIFICATION CODE*/ if( true ){ - gPC.puts("GC code match !!\r\n"); + /*gPC.puts("GC code match !!\r\n");*/ gFLAGS = gFLAGS | COM_SESSION_VALIDITY; COM_POWER_ON_TX; // PENDING: PA HOT HANDLED IN EXECUTE_XXX FUNCTIONS @@ -141,10 +141,10 @@ if( tempPAHot == 0xFF ){ gFLAGS = gFLAGS & ~(COM_PA_HOT_FLAG); gCOM_PA_COOLING_TIMEOUT.detach(); - gPC.puts("EXECUTING TELECOMMANDS\r\n"); + /*gPC.puts("EXECUTING TELECOMMANDS\r\n");*/ EXECUTE_OBOSC_ONLY; EXECUTE_TC; - gPC.puts("COMPLETED EXECUTION\r\n"); + /*gPC.puts("COMPLETED EXECUTION\r\n");*/ } else{ gFLAGS = gFLAGS | COM_PA_HOT_FLAG; @@ -155,7 +155,7 @@ } } else{ - gPC.puts("GS code mismatch !!\r\n"); + /*gPC.puts("GS code mismatch !!\r\n");*/ RX1M.attach(&rx_read, Serial::RxIrq); reset_all; gFLAGS = gFLAGS & (~COM_SESSION_VALIDITY); @@ -166,16 +166,16 @@ } } else{ - gPC.puts("tc list is not complete\r\n"); + /*gPC.puts("tc list is not complete\r\n");*/ if(tempContinue & 0x01){ - gPC.puts("last packet bit not found\r\n"); + /*gPC.puts("last packet bit not found\r\n");*/ } if( tempContinue & 0x02 ){ - gPC.puts("missing psc found\r\n"); + /*gPC.puts("missing psc found\r\n");*/ } - gPC.printf("crc fail tc = %u\r\n", gTOTAL_CRC_FAIL_TC); - gPC.printf("incorrect size tc = %u\r\n", gTOTAL_INCORRECT_SIZE_TC); - gPC.printf("repeated psc = %u\r\n", gTOTAL_REPEATED_TC); + /*gPC.printf("crc fail tc = %u\r\n", gTOTAL_CRC_FAIL_TC);*/ + /*gPC.printf("incorrect size tc = %u\r\n", gTOTAL_INCORRECT_SIZE_TC);*/ + /*gPC.printf("repeated psc = %u\r\n", gTOTAL_REPEATED_TC);*/ Base_tc *test_tc = gHEAD_NODE_TCL; while( test_tc != NULL ){ int length = 0; @@ -185,13 +185,13 @@ else{ length = TC_LONG_SIZE; } - for(int i = 0 ; i < length ; ++i ){ + /*for(int i = 0 ; i < length ; ++i ){ gPC.printf("%x ", test_tc->TC_string[i]); } - gPC.puts("\r\n"); + gPC.puts("\r\n");*/ test_tc = test_tc->next_TC; } - gPC.puts("\r\n"); + /*gPC.puts("\r\n");*/ COM_POWER_ON_TX; // PENDING : POWER OFF TX RX1M.attach(&rx_read, Serial::RxIrq); @@ -207,7 +207,7 @@ } } else{ - gPC.puts("No valid TC received\r\n"); + /*gPC.puts("No valid TC received\r\n");*/ RX1M.attach(&rx_read, Serial::RxIrq); gFLAGS = gFLAGS & (~COM_MNG_TMTC_RUNNING_FLAG); reset_all; @@ -217,7 +217,7 @@ } } else if( gFLAGS & COM_PA_HOT_FLAG ){ - gPC.puts("checking for PA hot in main\r\n"); + /*gPC.puts("checking for PA hot in main\r\n");*/ if( gFLAGS & COM_RX_FLAG ){ uint8_t tempPA = 0xFF; isPAhot(tempPA); @@ -236,7 +236,7 @@ gCOM_PA_COOLING_TIMEOUT.attach(&after_cooling_pa, COM_PA_COOLING_TIME_LIMIT); } else{ - gPC.puts("PA IS COOLED DOWN\r\n"); + /*gPC.puts("PA IS COOLED DOWN\r\n");*/ gFLAGS = gFLAGS & (~COM_PA_HOT_FLAG); gFLAGS = gFLAGS | COM_MNG_TMTC_RUNNING_FLAG; RX1M.attach(NULL); @@ -248,7 +248,7 @@ } } else if( gFLAGS & COM_SESSION_TIMEOUT_FLAG ){ - gPC.puts("session timeout: resetting in main\r\n"); + /*gPC.puts("session timeout: resetting in main\r\n");*/ COM_POWER_OFF_TX; /*PENDING : ENABLE THREADS*/ gSESSION_TIMEOUT.detach(); @@ -257,7 +257,7 @@ reset_all; } else{ - gPC.puts("INVALID SIGNAL RECEIVED IN MAIN\r\n"); + /*gPC.puts("INVALID SIGNAL RECEIVED IN MAIN\r\n");*/ // SOME INVALID SIGNAL RECEIVED COM_POWER_OFF_TX; reset_all;