working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Files at this revision

API Documentation at this revision

Comitter:
samp1234
Date:
Tue Mar 28 08:50:07 2017 +0000
Parent:
354:eb6c863756a8
Child:
356:197c93dc2012
Commit message:
Final with 1min obsrs

Changed in this revision

CDMS_HK.h Show annotated file Show diff for this revision Revisions of this file
Compression.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
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/CDMS_HK.h	Sat Mar 11 05:52:18 2017 +0000
+++ b/CDMS_HK.h	Tue Mar 28 08:50:07 2017 +0000
@@ -129,7 +129,7 @@
         CDMS_HEALTH_DATA[120] = COM_SESSION_TIMEOUT/60;
         CDMS_HEALTH_DATA[121] = COM_RSSI_MIN;
         CDMS_HEALTH_DATA[122] = SD_LIB_BLK_CURRENT>>8;
-        CDMS_HEALTH_DATA[122] = SD_LIB_BLK_CURRENT;
+        CDMS_HEALTH_DATA[123] = SD_LIB_BLK_CURRENT;
 
         uint32_t time = FCTN_CDMS_RD_RTC() >> 7;             //Reading Time from RTC
         for(int i = 124; i<128; i++)
--- a/Compression.h	Sat Mar 11 05:52:18 2017 +0000
+++ b/Compression.h	Tue Mar 28 08:50:07 2017 +0000
@@ -1377,7 +1377,8 @@
     //gPC.printf("\n\rsrp");
     debug_cntr = 0;
     sci_time = FCTN_CDMS_RD_RTC();
-    TIME_LATEST_SPI_SPEED = sci_time;
+  //  TIME_LATEST_SPI_SPEED = sci_time;
+    TIME_LATEST_SPI_SPEED = sci_time >> 7;
     #if debug_time
     gPC.printf("\n\rAssigning time manually");
         sci_time = 0x000000055555555;
--- a/FMS_all.h	Sat Mar 11 05:52:18 2017 +0000
+++ b/FMS_all.h	Tue Mar 28 08:50:07 2017 +0000
@@ -94,7 +94,8 @@
     SD_CARD_fromuC_ENA3 = 0; 
     SD_CARD_fromISO_ENA4 = 0;
     SD_SW_EN_DS = 0;
-    SD_STATUS = DEVICE_DISABLED;
+   // SD_STATUS = DEVICE_DISABLED;
+   SD_STATUS = 0;
    FCTN_CDMS_WR_FLASH(2,DEVICE_DISABLED);
     gPC.printf("sw off sd\n");
 }
@@ -113,8 +114,8 @@
     spi.write(0x00);//enabling halt bit in the seconds register
     gCS_RTC=1;
      EN_RTC = 0x01;
-//    CDMS_RTC_DISABLE =1;
-    FCTN_CDMS_WR_FLASH(1,DEVICE_POWERED);
+    CDMS_RTC_DISABLE =1;
+    FCTN_CDMS_WR_FLASH(6,DEVICE_POWERED);
   //  gPC.printf("0x%08X \n", READ_FROM_EERPOM(6));
     SPI_mutex.unlock();
     gPC.printf("sw on rtc\n");
@@ -134,7 +135,7 @@
     gCS_RTC=1;
    
    EN_RTC  = 0x00;
-//    CDMS_RTC_DISABLE = 0;
+   CDMS_RTC_DISABLE = 0;
     FCTN_CDMS_WR_FLASH(6,0x00);
     SPI_mutex.unlock();
     gPC.printf("sw off rtc\n");
@@ -151,7 +152,8 @@
 void SW_OFF_BAE()
 {
     BAE_SW_EN_DS = 0;
-    BAE_STATUS = DEVICE_DISABLED;
+ //   BAE_STATUS = DEVICE_DISABLED;
+     BAE_STATUS = 0;
      FCTN_CDMS_WR_FLASH(1,DEVICE_DISABLED);
     gPC.printf("sw off bae\n");
 }
@@ -178,7 +180,8 @@
     wait_us(1);
     PYLD_DFF_CLK = 0;
     wait_us(1);
-    PL_STATUS = DEVICE_DISABLED;
+ //   PL_STATUS = DEVICE_DISABLED;
+    PL_STATUS = 0;
    FCTN_CDMS_WR_FLASH(3,DEVICE_DISABLED);
 }
 
@@ -192,6 +195,7 @@
     PYLD_EPS_DFF_PWR_CLK = 0;
     wait_us(1);
     PL_EPS_LATCH_SW_EN = 1;
+    
     FCTN_CDMS_WR_FLASH(4,1);
 }
 
@@ -205,6 +209,7 @@
     PYLD_EPS_DFF_PWR_CLK = 0;
     wait_us(1);
     PL_EPS_LATCH_SW_EN = 0;
+    
     FCTN_CDMS_WR_FLASH(4,0);
 }
 
--- a/main.cpp	Sat Mar 11 05:52:18 2017 +0000
+++ b/main.cpp	Tue Mar 28 08:50:07 2017 +0000
@@ -101,7 +101,7 @@
   
     for(int i =0; i<512; i++)
         test[i] = 0;
-    //disk_write(test,80000);
+    disk_write(test,80000);
    
     //SD_MNG_SECT = SD_LIB_BLK_CURRENT;
     FCTN_SD_MNGR();