Simple version of COM_MNG_TMTC_CODE for IITMSAT.

Dependencies:   mbed-rtos mbed FreescaleIAP SimpleDMA

Revision:
78:8501118c428f
Parent:
77:11318af9b144
Child:
79:aa2d0f67b693
--- a/COM_MNG_TMTC.h	Tue Jan 19 05:57:10 2016 +0000
+++ b/COM_MNG_TMTC.h	Tue Jan 19 05:58:08 2016 +0000
@@ -1325,6 +1325,9 @@
                                 /*gPC.printf("obosc tc inside normal tc at %u\r\n", execute_psc);*/\
                                 /*EXECUTION OF OBOSC TC*/\
                                 /*SKIP EXECUTION OF OBOSC HERE*/\
+                                if( execute_psc == (gTOTAL_VALID_TC-1) ){\
+                                    gMASTER_STATE = TCL_STATE_COMPLETED;\
+                                }\
                                 break;\
                             }\
                             else{\
@@ -1354,25 +1357,6 @@
                                 /*LAST TC IS EXECUTED*/\
                                 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->fields) == SHORT_TM_CODE ){\
@@ -1408,39 +1392,10 @@
                             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->fields) == 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 DATA TO GS*/\
+                            /*Send call sign, ACK_L1, NON OBSRS TM*/\
                             snd_tm.head_pointer(tm_ptr_head);\
                             adf_not_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;\
-                                }\ 
-                            }\
+                            delete_all_tm(tm_ptr_head);\
                         }\
                         else{\
                             /*gPC.printf("sd card at %u\r\n", execute_psc);*/\