Latest FM Code with EEPROM

Dependencies:   FreescaleIAP SimpleDMA eeprom mbed-rtos mbed

Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by Team Fox

Revision:
207:28a07943dded
Parent:
206:fba4aeebf004
diff -r fba4aeebf004 -r 28a07943dded COM_MNG_TMTC.h
--- a/COM_MNG_TMTC.h	Thu Jun 30 14:00:33 2016 +0000
+++ b/COM_MNG_TMTC.h	Sat Jul 02 10:48:30 2016 +0000
@@ -356,6 +356,7 @@
     {
         case 1: //apid=01 implies it corresponds to bae
         {
+            BAE_I2C_mutex.lock();
             gPC.printf("Telecommand is for BAE\r\n");
             gPC.printf("Sending TC to BAE...\r\n"); //interrupt to be sent to the bae
             y = FCTN_I2C_WRITE((char*)tc_ptr->TC_string,TC_LONG_SIZE);                         // Check for SHORT and LONG TC and then send
@@ -399,6 +400,7 @@
                     return tm_ptr_short;
                 }
             }
+            BAE_I2C_mutex.unlock();
         }
 
         case 2: // APID = 2 corresponds to CDMS
@@ -701,6 +703,13 @@
                             ACK_L234(tm_ptr_short,0xC0,GETpacket_seq_count(tc_ptr));
                             return tm_ptr_short;                                                        
                         }
+                        else if(GETpid(tc_ptr)==0x38)
+                        {
+                            //gPC.printf()
+                            
+                            CDMS_INTERNAL_RESET();
+                            ACK_L234(tm_ptr_short,0xC0,GETpacket_seq_count(tc_ptr));
+                        }
                         else if(GETpid(tc_ptr)==0x40)
                         {                         
                             //gPC.printf("RESET_HK_COUNTER\r\n"); // call PWR_SWCH_ON function
@@ -740,7 +749,13 @@
                             tm_pointer->TM_string[132] = (uint8_t)((crc16&0xFF00)>>8);
                             tm_pointer->TM_string[133] = (uint8_t)(crc16&0x00FF);
                             tm_pointer->next_TM = NULL;                 
-                            return tm_ptr;                                                     //incomplete
+                            return tm_ptr; */                                                    //incomplete
+                        }
+                        else if(GETpid(tc_ptr)==0xF0)
+                        {
+                            uint8_t statusbits[64];
+                            CDMS_RD_SD_HK(statusbits);
+                            ACK_L234(tm_ptr_short,0xC0,GETpacket_seq_count(tc_ptr));
                         }                               
                         else 
                         {
@@ -755,7 +770,7 @@
                         ACK_L234(tm_ptr_short,0x02,GETpacket_seq_count(tc_ptr));  
                         return tm_ptr_short;
                     }                                    
-                }*/
+                }
                 case 0x70:
                 {
                     gPC.printf("\n\n\rService:PAYLOAD MANAGEMENT SERVICE");