working version

Dependencies:   mbed mbed-rtos SimpleDMA FreescaleIAP eeprom

Fork of CDMS_CODE_FM_28JAN2017 by samp Srinivasan

Revision:
352:022c513aee03
Parent:
351:a89a46894ec0
Child:
353:e1803e801e20
diff -r a89a46894ec0 -r 022c513aee03 CDMS_HK.h
--- a/CDMS_HK.h	Sun Jan 22 04:47:11 2017 +0000
+++ b/CDMS_HK.h	Mon Feb 06 16:36:46 2017 +0000
@@ -17,17 +17,18 @@
 AnalogIn CDMS_temp_sensor(PIN53);
 AnalogIn COMRX_RSSI_VOLTAGE(PIN70);
 AnalogIn EPS_BTRY_VOLT (PIN54);
+AnalogIn BAE_CURRENT_MUX_OUT (PIN53);
 
 DigitalOut SelectLinec3 (PIN79); // MSB of Select Lines
 DigitalOut SelectLinec2 (PIN78);
-DigitalOut SelectLinec1 (PIN76);
-DigitalOut SelectLinec0 (PIN77); // LSB of Select Lines
+// SBC V1.0
+//DigitalOut SelectLinec1 (PIN76);
+//DigitalOut SelectLinec0 (PIN77); // LSB of Select Lines
 
-/*
-Before SBC. To be restored in FM model
+// SBC V2.0
 DigitalOut SelectLinec1 (PIN77);
 DigitalOut SelectLinec0 (PIN76); // LSB of Select Lines
-*/
+
 
 Convolution CDMS_HEALTH;
 Convolution BAE_HEALTH;
@@ -186,7 +187,7 @@
      //  gPC.printf("BAE_HK_");
             crc = crc16_gen((unsigned char *)BAE_HK,132);
             if(crc == ((uint16_t)BAE_HK[132] << 8) | (uint16_t)BAE_HK[133]) {
-                //gPC.printf("BAE HK data recieved through I2C\t");
+                gPC.printf("BAE HK data recieved through I2C\t");
                 TIME_LATEST_I2C_BAE = FCTN_CDMS_RD_RTC() >> 7;
                 /*for(int i = 0; i<15; i++)
                     gPC.printf("\r 0x%02X\n",BAE_HK[i]);*/
@@ -226,8 +227,10 @@
 
         } else {
             gPC.printf("BAE HK data not recieved through I2C\t");
+            gPC.printf("/r/n ack= %d",BAE_HK_I2C);
             for(int i = 0; i<134; i++)
                 BAE_HK[i] = 0;
+                
         }
         // gPC.printf("Completed BAE HK\n");
 
@@ -482,12 +485,16 @@
     if(SD_STATUS != DEVICE_DISABLED) {
         if(SD_STATUS == DEVICE_OC_FAULT) {
             gPC.printf("Switching on SD card");
+            SD_CARD_fromuC_ENA3 = 1; 
+            SD_CARD_fromISO_ENA4 = 1;
             SD_SW_EN_DS = 1; //powering on SD
             wait_ms(10);
         }
 
         if(SD_OC_FAULT == 0) {
             gPC.printf("Switching off SD card");
+            SD_CARD_fromuC_ENA3 = 0; 
+            SD_CARD_fromISO_ENA4 = 0;
             SD_SW_EN_DS = 0; //switching off SD card
             SD_FAULTCOUNT++;
             SD_STATUS = (SD_FAULTCOUNT == 3) ? DEVICE_DISABLED :DEVICE_OC_FAULT;