To fix the hang problem

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

Files at this revision

API Documentation at this revision

Comitter:
spacelab
Date:
Wed Dec 21 09:19:25 2016 +0000
Parent:
329:a43494bb338f
Child:
331:1943be3fd178
Commit message:
chaithanya Here: corrected time tags

Changed in this revision

CDMS_HK.h Show annotated file Show diff for this revision Revisions of this file
COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
FMS_all.h Show annotated file Show diff for this revision Revisions of this file
i2c.h Show annotated file Show diff for this revision Revisions of this file
--- a/CDMS_HK.h	Wed Dec 21 06:06:32 2016 +0000
+++ b/CDMS_HK.h	Wed Dec 21 09:19:25 2016 +0000
@@ -234,6 +234,7 @@
     bool y;
     y = FCTN_I2C_WRITE((char *)beacon_array,134);
     if(y == 0){
+       TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
        //gPC.printf("long Bcn sent\n\r");
     }
         else
--- a/COM_MNG_TMTC.h	Wed Dec 21 06:06:32 2016 +0000
+++ b/COM_MNG_TMTC.h	Wed Dec 21 09:19:25 2016 +0000
@@ -371,6 +371,7 @@
             }                                  
             else if(y==0)
             {
+                TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
                 gPC.printf("Write success\r\n");
                 //wait(0.2);
                 int poll=0;
@@ -386,6 +387,7 @@
                     y=FCTN_I2C_READ((char*)tm_ptr->TM_string,TM_LONG_SIZE);
                     if(y==0)
                     {
+                        TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
                         gPC.printf("Read success\r\n");
                         tm_ptr->next_TM=NULL;
                         return tm_ptr;
@@ -1124,6 +1126,7 @@
             }                                  
             else if(y==0)
             {
+                TIME_LATEST_I2C_SPEED = FCTN_CDMS_RD_RTC() >> 7;
                 //wait(0.2);
                 int poll=0;
                 while(poll<2000 && PL_I2C_Intr==0)
@@ -1141,6 +1144,7 @@
                     gPC.printf("%X",(int)(tm_ptr->TM_string[i]));
                     if(y==0)
                     {
+                        TIME_LATEST_I2C_SPEED = FCTN_CDMS_RD_RTC() >> 7;
                         tm_ptr->next_TM=NULL;
                         return tm_ptr;
                     }
--- a/FMS_all.h	Wed Dec 21 06:06:32 2016 +0000
+++ b/FMS_all.h	Wed Dec 21 09:19:25 2016 +0000
@@ -340,11 +340,15 @@
 
 void FCTN_CDMS_RD_L_RAM(Base_tm *tm_pointer)
 {
+    uint32_t time = FCTN_CDMS_RD_RTC() >> 7;             //Reading Time from RTC
+    for(int i = 124; i<128; i++)
+    CDMS_HEALTH_DATA[i] = time >> (127-i)*8;
     for(int i=0;i<128;i++)
     {
         //tm_pointer->TM_string[i] = 0;
         tm_pointer->TM_string[i+4] = CDMS_HEALTH_DATA[i];
     }
+    
 }
 
 void FCTN_CDMS_MAX_MIN(Base_tm *tm_pointer)
--- a/i2c.h	Wed Dec 21 06:06:32 2016 +0000
+++ b/i2c.h	Wed Dec 21 09:19:25 2016 +0000
@@ -45,7 +45,6 @@
         }
         if(((pdirr1 & 0x03000000)==0x03000000))//if SCL and SDA are both high
         {    
-            TIME_LATEST_I2C_SPEED = FCTN_CDMS_RD_RTC() >> 7;
             gPC.printf("\n\rData received from PL");
         }
         else 
@@ -80,7 +79,6 @@
         }
         if(((pdirw1 & 0x03000000)==0x03000000))
         {
-            TIME_LATEST_I2C_SPEED = FCTN_CDMS_RD_RTC() >> 7;
             gPC.printf("\n\r Data sent");        
         }
         else
@@ -114,7 +112,6 @@
         }
         if(((pdirr1 & 0x03000000)==0x03000000))//if SCL and SDA are both high
         {    
-            TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
             //gPC.printf("\n\rData received from BAE");
         }
         else 
@@ -151,7 +148,6 @@
         }
         if(((pdirw1 & 0x03000000)==0x03000000))
         {
-            TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
             //gPC.printf("\n\r Data sent");        
         }
         else