working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Revision:
308:7c3872365d58
Parent:
305:beb148fe97dc
Child:
311:af5ab655ba00
--- a/main.cpp	Sat Sep 10 07:06:59 2016 +0000
+++ b/main.cpp	Sun Oct 09 07:08:34 2016 +0000
@@ -69,17 +69,21 @@
     spi.format(8,0);
     spi.frequency(500000);
 
+    SD_SW_EN_DS = 0; 
+    wait(1);
+    SD_SW_EN_DS = 1;
+    wait(1);
     // SD CARD
     cs_sd = 1;
     gCS_RTC = 1;
     gCS_ADF = 1;
     
     FCTN_CDMS_INIT_RTC();/* rtc initialization*/
-    //FCTN_CDMS_SD_INIT();/* sd card initialization*/
+    FCTN_CDMS_SD_INIT();/* sd card initialization*/
     
     
     uint8_t test[512] = {0};
-    //disk_write(test,7000); //to be used only just before launch
+    disk_write(test,8000); //to be used only just before launch
     
     #if DEBUG
     gPC.puts("welcome to mng_tmtc\r\n");
@@ -93,13 +97,13 @@
     
     // COM_MNG_TMTC THREAD
     gCOM_MNG_TMTC_THREAD = new Thread(COM_MNG_TMTC_FUN);
-    gCOM_MNG_TMTC_THREAD->set_priority(osPriorityHigh);
+    gCOM_MNG_TMTC_THREAD->set_priority(osPriorityRealtime);
     
     gHK_THREAD = new Thread(FCTN_CDMS_HK_MAIN);
     gHK_THREAD->set_priority(osPriorityAboveNormal);
     
     gSCIENCE_THREAD = new Thread(SCIENCE_FUN);
-    gSCIENCE_THREAD->set_priority(osPriorityAboveNormal);
+    gSCIENCE_THREAD->set_priority(osPriorityHigh);
     
     #if DEBUG
     gPC.puts("completed allocating threads\r\n");
@@ -108,7 +112,7 @@
     master.frequency(400000);
     
     HK_counter = new RtosTimer(hk_isr, osTimerPeriodic,(void * )NULL);
-    //gHK_THREAD->signal_set(HK_SIGNAL);
+    gHK_THREAD->signal_set(HK_SIGNAL);
     HK_counter->start(10000);
     
     sys_reset_cdms_timer = new RtosTimer(sys_pwr_reset, osTimerPeriodic, (void * )NULL);