Latest FM Code with EEPROM

Dependencies:   FreescaleIAP SimpleDMA eeprom mbed-rtos mbed

Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by Team Fox

Revision:
183:fba74e465e1a
Parent:
182:8b73c010286b
Child:
184:d75cea6f5d49
--- a/COM_MNG_TMTC.h	Sat Jun 04 11:25:24 2016 +0000
+++ b/COM_MNG_TMTC.h	Sat Jun 11 08:51:16 2016 +0000
@@ -801,28 +801,29 @@
                 FCTN_I2C_WRITE_PL((char*)tc_ptr->TC_string,TC_SHORT_SIZE);
             }
             
+            
             while(1)
             {
-                wait(1);
-                if(rcv_isr == 1)
+                if(PYLD_I2C_Int == 1)
                 {
-                    //gPC.printf("i2c_t = %d",t_pl.read_ms());  
-                        for(int i = 0;i< PL_TM_SIZE;i++)
+                    read_ack = master.read(addr_pl|1,PL_I2C_DATA,134);
+                    if(read_ack) gPC.printf("\n\rData not received from PL \n") else gPC.printf("\n\rData received from PL \n");
+                    gLEDR=!gLEDR;
+                    for(int i = 0;i< PL_TM_SIZE;i++)
                         tm_pointer->TM_string[i] = PL_I2C_DATA[i];
                         received++;
-                        rcv_isr = 0; 
-                        break;
+                    break;   
                 }
-                else
-                {
-                    gPC.printf("\n\rData received from PL \n");
-                    break;
-                    }
+            }
+            else
+            {
+                
+                break;
             }
             if(received < 1 )
             {
-                //printf("Telemetry is not received from BAE\r\n");
-                //tm_pointer = new Short_tm;
+                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);
                 tm_pointer->TM_string[2] = 0x00;