FM

Dependencies:   SimpleDMA eeprom mbed-rtos mbed FreescaleIAP

Fork of CDMS_CODE by shubham c

Revision:
352:022c513aee03
Parent:
351:a89a46894ec0
Child:
353:e1803e801e20
--- a/main.cpp	Sun Jan 22 04:47:11 2017 +0000
+++ b/main.cpp	Mon Feb 06 16:36:46 2017 +0000
@@ -33,11 +33,11 @@
 #include "COM_POWER_ON_TX.h"
 #include "OBSRS.h"
 #include "ThreadsAndFunctions.h"
-#include "TEST_PL.h"
+//#include "TEST_PL.h"
 
 int main()
 {    
-    
+   
     //RELAY SWITCHING 
     
     
@@ -70,10 +70,14 @@
     // COMMON SPI
     spi.format(8,0);
     spi.frequency(500000);
-
+    SD_CARD_fromuC_ENA3 = 0; 
+    SD_CARD_fromISO_ENA4 = 0;
     SD_SW_EN_DS = 0; 
     wait(1);
+    SD_CARD_fromuC_ENA3 = 1; 
+    SD_CARD_fromISO_ENA4 = 1;
     SD_SW_EN_DS = 1;
+    
     wait(1);
     // SD CARD
     cs_sd = 1;
@@ -83,16 +87,19 @@
     
     FCTN_CDMS_INIT_RTC();/* rtc initialization*/
     FCTN_CDMS_SD_INIT();/* sd card initialization*/
-    
+    INIT_EEPROM(); // added by samp
+
     CDMS_RESET_COUNTER++;
     WRITE_TO_EEPROM(7,CDMS_RESET_COUNTER);
     TIME_LATEST_CDSMS_RESET = FCTN_CDMS_RD_RTC() >> 7;
     WRITE_TO_EEPROM(8,TIME_LATEST_CDSMS_RESET);
-    
+  /*  
     uint8_t test[512];
+  
     for(int i =0; i<512; i++)
         test[i] = 0;
-    disk_write(test,80000);
+    disk_write(test,8000);
+   */
     //SD_MNG_SECT = SD_LIB_BLK_CURRENT;
     FCTN_SD_MNGR();
 
@@ -128,7 +135,10 @@
     
     HK_counter = new RtosTimer(hk_isr, osTimerPeriodic,(void * )NULL);
     gHK_THREAD->signal_set(HK_SIGNAL);
+   HK_counter->stop();
+   wait_ms(0.1);
    HK_counter->start(10000);
+  // HK_counter->start(10000);
     
     sys_reset_cdms_timer = new RtosTimer(sys_pwr_reset, osTimerPeriodic, (void * )NULL);
     sys_reset_cdms_timer->start(cdms_reset_timeout);