Latest FM Code with EEPROM
Dependencies: FreescaleIAP SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by
Diff: COM_MNG_TMTC.h
- Revision:
- 108:2efd0974d40b
- Parent:
- 103:b55559925dc1
--- a/COM_MNG_TMTC.h Fri Jan 29 19:27:28 2016 +0000 +++ b/COM_MNG_TMTC.h Wed Feb 03 13:20:11 2016 +0000 @@ -1430,114 +1430,13 @@ }\ }\ else{\ - /*gPC.printf("sd card at %u\r\n", execute_psc);*/\ /*EXECUTION OF SD-CARD DATA SENDING (OBSRS)*/\ - Base_tm *tm_ptr_head = NULL;\ - get_call_sign(tm_ptr_head);\ - Base_tm *put_tm_here = NULL;\ - /*execute_obsrs(current_TC, put_tm_here)*/\ - /*read_TC(current_TC);*/\ + /*Call sign, Exec status, Master_state update, ACK_L1, check for PA_HOT and SEND call sign, ACK_L1, OBSRS TO GS*/\ + /*ABORT ON NACK CHECK, gMASTER_STATE VERIFICATION WITH SD CARD, session timeout*/\ execute_OBSRS_TC(current_TC);\ gPC.puts("en_adf");\ transmit_adf;\ gPC.puts("ex_adf");\ - uint8_t tempExec = TC_STATE_SUCCESSFULLY_EXECUTED;\ - PUTexec_status(current_TC, tempExec);\ - /*PENDING: ABORT ON NACK CHECK, gMASTER_STATE VERIFICATION WITH SD CARD, session timeout, last executed ack l234*/\ - if( (GETexec_status(current_TC) == TC_STATE_EXECUTION_FAILED) && (GETabort_on_nack(current_TC) == 1) ){\ - gMASTER_STATE = TCL_STATE_ABORTED;\ - }\ - else if( execute_psc == (gTOTAL_VALID_TC-1) ){\ - gMASTER_STATE = TCL_STATE_COMPLETED;\ - }\ - else{\ - uint8_t check1 = 1;\ - for( uint8_t test_psc = execute_psc+1 ; test_psc < gTOTAL_VALID_TC ; ++test_psc ){\ - Base_tc* test_TC = gHEAD_NODE_TCL;\ - while(test_TC != NULL){\ - if( GETpacket_seq_count(test_TC) == test_psc ){\ - uint8_t checkval;\ - isit_obosc(test_TC, checkval);\ - if( checkval == 0 ){\ - check1 = 0;\ - }\ - }\ - test_TC = test_TC->next_TC;\ - }\ - }\ - if( check1 == 0x01 ){\ - gMASTER_STATE = TCL_STATE_COMPLETED;\ - }\ - }\ - /*update last executed L1_ack*/\ - if( put_tm_here != NULL ){\ - if( GETshort_or_long_tm(put_tm_here) == SHORT_TM_CODE ){\ - for(int i = 0 ; i < TM_SHORT_SIZE ; ++i){\ - gLAST_TM[i] = put_tm_here->TM_string[i];\ - gLAST_TM_SHORT_OR_LONG = SHORT_TM_CODE;\ - }\ - }\ - else{\ - for( int i = 0 ; i < TM_LONG_SIZE ; ++i ){\ - gLAST_TM[i] = put_tm_here->TM_string[i];\ - gLAST_TM_SHORT_OR_LONG = LONG_TM_CODE;\ - }\ - }\ - }\ - /*PENDING: APPEND ACK L1*/\ - Base_tm *tm_ptr = tm_ptr_head;\ - get_ack_l1(tm_ptr->next_TM);\ - int overflowCountExecute = 0;\ - while( tm_ptr->next_TM != NULL ){\ - if( overflowCountExecute < TM_OVERFLOW_CONSTANT ){\ - tm_ptr = tm_ptr->next_TM;\ - ++overflowCountExecute;\ - }\ - else{\ - /*PENDING: RESET CDMS*/\ - break;\ - }\ - }\ - tm_ptr->next_TM = put_tm_here;\ - /*CHECK FOR HOT PA*/\ - uint8_t tempPAhot = 0x00;\ - isPAhot(tempPAhot);\ - if( tempPAhot == 0x00 ){\ - gFLAGS = gFLAGS | COM_PA_HOT_FLAG;\ - }\ - tm_ptr = tm_ptr_head;\ - while( tm_ptr != NULL ){\ - int length = TM_SHORT_SIZE;\ - if( GETshort_or_long_tm(tm_ptr) == SHORT_TM_CODE ){\ - length = TM_SHORT_SIZE;\ - }\ - else{\ - length = TM_LONG_SIZE;\ - }\ - /*gPC.puts("Printing Call Sign, ACK_L1, TM list");*/\ - for(int i = 0 ; i < length ; ++i){\ - /*gPC.putc(tm_ptr->TM_string[i]);*/\ - }\ - tm_ptr = tm_ptr->next_TM;\ - }\ - /*SEND call sign, ACK_L1, OBSRS TO GS*/\ - /*snd_tm.head_pointer(tm_ptr_head);*/\ - /*adf_SDcard();*/\ - /*DELETE THE TM AFTER USE*/\ - tm_ptr = tm_ptr_head;\ - overflowCountExecute = 0;\ - while(tm_ptr != NULL){\ - if( overflowCountExecute < TM_OVERFLOW_CONSTANT ){\ - Base_tm *temp = tm_ptr->next_TM;\ - delete tm_ptr;\ - tm_ptr = temp;\ - ++overflowCountExecute;\ - }\ - else{\ - /*PENDING: RESET CDMS*/\ - break;\ - }\ - }\ }\ }\ break;\