sd 32 update

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Revision:
55:39e59903bc3a
Parent:
53:18db568f1098
Child:
57:bf998cb2a104
--- a/COM_MNG_TMTC.h	Thu Jan 14 13:26:40 2016 +0000
+++ b/COM_MNG_TMTC.h	Thu Jan 14 15:00:25 2016 +0000
@@ -409,7 +409,7 @@
 // CDMS TEAM CODE START
 inline Base_tm* FCTN_CDMS_RLY_TMTC(Base_tc *tc_ptr){
     uint8_t ACKCODE = 0x00;
-    printf("\rTC execution in progress\r\n");
+    //printf("\rTC execution in progress\r\n");
     Base_tm *tm_pointer = new Long_tm;
     Base_tm *tm_ptr = tm_pointer;
     received = 0;
@@ -417,15 +417,15 @@
     {
         case 1: //apid=01 implies it corresponds to bae
         {
-            printf("Telecommand is for BAE\r\n");
-            printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
+            //printf("Telecommand is for BAE\r\n");
+            //printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
             FCTN_I2C_WRITE((char*)tc_ptr->TC_string);
             while(1)
             {
                 wait(1); //TimeOut instead of wait
                 if(tm_status_4m_slv == 1)
                 {
-                    printf("receiving...\r\n");
+                    //printf("receiving...\r\n");
                     FCTN_I2C_READ((char*)tm_pointer->TM_string);
                     //printf("%s", tm_pointer->TM_string);
                     received+=1;
@@ -439,11 +439,11 @@
             }
             if(received >= 1 )
             {
-                printf("Telemetry is received from BAE\r\n");
+                //printf("Telemetry is received from BAE\r\n");
                 Base_tm *tm_print = tm_ptr;
                 for(uint8_t i=0;i<received;i++)
                 {  
-                    printf("%s", tm_print->TM_string);
+                    //printf("%s", tm_print->TM_string);
                     tm_print = tm_print->next_TM; //for check
                 }
                 received  = 0;
@@ -451,7 +451,7 @@
             }
             else
             {
-                printf("Telemetry is not received from BAE\r\n");
+                //printf("Telemetry is not received from BAE\r\n");
                 //tm_pointer = new Short_tm;
                 tm_pointer->TM_string[0] = 0xB0;
                 tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);
@@ -471,17 +471,17 @@
         }
         case 2:
         {
-            printf("Telecommand is for CDMS\r\n"); //apid = 10 corresponds to cdms
+            //printf("Telecommand is for CDMS\r\n"); //apid = 10 corresponds to cdms
             switch(GETservice_type(tc_ptr))
             {
                 case 0x60:
                 {
-                        printf("service:MMS\r\n");
+                        //printf("service:MMS\r\n");
                         switch(GETservice_subtype(tc_ptr))
                         {
                             case 0x1:
                             {
-                            printf("sub_service:Read from RAM_Memory\r\n");
+                            //printf("sub_service:Read from RAM_Memory\r\n");
                             mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]);                                                       
                                                              
                                     Data[0] = FCTN_CDMS_RD_FLASH(0);
@@ -505,7 +505,7 @@
                             }                            
                             case 0x2:
                             {
-                            printf("sub_service:Read from Flash_Memory\r\n");
+                            //printf("sub_service:Read from Flash_Memory\r\n");
                             mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]);                           
                                                                                              
                                     Data[0] = FCTN_CDMS_RD_FLASH(0);
@@ -529,7 +529,7 @@
                             }                           
                             case 0x5:
                             {
-                            printf("WRITE ON FLASH_MEMORY\r\n");                          
+                            //printf("WRITE ON FLASH_MEMORY\r\n");                          
                                     mid=(uint16_t)(tc_ptr->TC_string[3]<<4)+(uint16_t)(tc_ptr->TC_string[4]);                                   
                                     block = (((uint32_t)(tc_ptr->TC_string[5])<<24)|((uint32_t)(tc_ptr->TC_string[5])<<16)|((uint32_t)(tc_ptr->TC_string[5])<<8)|((uint32_t)(tc_ptr->TC_string[5])));
                                     FCTN_CDMS_WR_FLASH(mid,block);
@@ -551,7 +551,7 @@
                             }                                                    
                             default:
                             {
-                                printf("INVALID TC\r\n"); //Send Invalid TC Telemetry
+                                //printf("INVALID TC\r\n"); //Send Invalid TC Telemetry
                                 //tm_pointer = new Short_tm;
                                 tm_pointer->TM_string[0] = 0xB0;
                                 tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);
@@ -572,12 +572,12 @@
                     }                                                                   
                     case 0x8:
                     {
-                        printf("service:FUNCTION MANAGEMENT SERVICE\r\n"); 
+                        //printf("service:FUNCTION MANAGEMENT SERVICE\r\n"); 
                         if(GETservice_subtype(tc_ptr)==0x1)
                             {                               
                               if(GETpid(tc_ptr)==0x01)
                                 {
-                                    printf("TC_PL_INIT\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_PL_INIT\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -594,7 +594,7 @@
                                 }                                
                                 else if(GETpid(tc_ptr)==0x02)
                                 {
-                                    printf("TC_PL_MAIN\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_PL_MAIN\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -611,7 +611,7 @@
                                 }
                                else if(GETpid(tc_ptr)==0x03)
                                 {
-                                    printf("TC_COM_INIT\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_COM_INIT\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -628,7 +628,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x04)
                                 {
-                                    printf("TC_CDMS_HK_MAIN\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_CDMS_HK_MAIN\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -645,7 +645,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x11)
                                 {
-                                    printf("TC_SW_ON_SD\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_SD\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -662,7 +662,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x12)
                                 {
-                                    printf("TC_SW_ON_RTC\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_RTC\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -679,7 +679,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x13)
                                 {
-                                    printf("TC_SW_ON_BAE\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_BAE\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -696,7 +696,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x14)
                                 {
-                                    printf("TC_SW_ON_PL_DL\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_PL_DL\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -713,7 +713,7 @@
                                 }
                                  else if(GETpid(tc_ptr)==0x15)
                                 {
-                                    printf("TC_SW_ON_PL_AG_HV\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_PL_AG_HV\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -730,7 +730,7 @@
                                 }
                                  else if(GETpid(tc_ptr)==0x16)
                                 {
-                                    printf("TC_SW_ON_V_A_EN\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_ON_V_A_EN\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -747,7 +747,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x21)
                                 {
-                                    printf("TC_SW_OFF_SD\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_SD\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -764,7 +764,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x22)
                                 {
-                                    printf("TC_SW_OFF_RTC\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_RTC\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -781,7 +781,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x23)
                                 {
-                                    printf("TC_SW_OFF_BAE\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_BAE\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -798,7 +798,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x24)
                                 {
-                                    printf("TC_SW_OFF_PL_DL\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_PL_DL\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -815,7 +815,7 @@
                                 }
                                  else if(GETpid(tc_ptr)==0x25)
                                 {
-                                    printf("TC_SW_OFF_PL_AG_HV\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_PL_AG_HV\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -832,7 +832,7 @@
                                 }
                                  else if(GETpid(tc_ptr)==0x26)
                                 {
-                                    printf("TC_SW_OFF_V_A_EN\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_SW_OFF_V_A_EN\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -849,7 +849,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x31)
                                 {
-                                    printf("TC_RST_SD\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_RST_SD\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -866,7 +866,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x32)
                                 {
-                                    printf("TC_RST_RTC\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_RST_RTC\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -883,7 +883,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x33)
                                 {
-                                    printf("TC_RST_BAE\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_RST_BAE\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -900,7 +900,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0x34)
                                 {
-                                    printf("TC_RST_PL_DL\r\n"); // call PWR_SWCH_ON function
+                                    //printf("TC_RST_PL_DL\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -918,7 +918,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0xC1)
                                 {
-                                    printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function
+                                    //printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -935,7 +935,7 @@
                                 }
                                 else if(GETpid(tc_ptr)==0xF1)
                                 {
-                                    printf("RD_RTC\r\n"); //call RD_RTC
+                                    //printf("RD_RTC\r\n"); //call RD_RTC
                                     //tm_pointer = new Short_tm;
                                     tm_pointer->TM_string[0] = 0xD0;
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);
@@ -956,7 +956,7 @@
                                 }                               
                                 else 
                                 {
-                                    printf("INVALID TC\r\n");
+                                    //printf("INVALID TC\r\n");
                                     //tm_pointer = new Short_tm; 
                                     tm_pointer->TM_string[0] = 0xB0; 
                                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -978,7 +978,7 @@
                 }
                 default:
                 {
-                    printf("INVALID TC"); //send invalid TC TM
+                    //printf("INVALID TC"); //send invalid TC TM
                     //tm_pointer = new Short_tm; 
                     tm_pointer->TM_string[0] = 0xB0; 
                     tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -999,7 +999,7 @@
         }
         case 3:
         {
-            printf("Telecommand is for PL\r\n");
+            //printf("Telecommand is for PL\r\n");
             // printf("Informing PL about TC using I2C\r\n"); //interrupt to be sent to the bae
             // FCTN_I2C_WRITE((char*)tc_ptr->TC_string);
             // printf("sent the Telecommand to BAE\r\n"); //packet along with crc will be sent when bae is ready
@@ -1019,7 +1019,7 @@
         }
         default: //invalid TC
         {
-            printf("INVALID TC\r\n");
+            //printf("INVALID TC\r\n");
             //tm_pointer = new Short_tm; 
             tm_pointer->TM_string[0] = 0xB0; 
             tm_pointer->TM_string[1] = GETpacket_seq_count(tc_ptr);                                    
@@ -1224,7 +1224,7 @@
                                     length = TM_LONG_SIZE;\
                                 }\
                                 for(int i = 0 ; i < length ; ++i){\
-                                    gPC.putc(obosc_tm_current->TM_string[i]);\
+                                    /*gPC.putc(obosc_tm_current->TM_string[i]);*/\
                                 }\
                                 obosc_tm_current = obosc_tm_current->next_TM;\
                             }\