CDMS_CODE_samp_23SEP_DMA_flag

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE_samp_23SEP_DMA by iitm sat

Files at this revision

API Documentation at this revision

Comitter:
chaithanyarss
Date:
Sun Aug 28 14:47:38 2016 +0000
Parent:
295:699801854b71
Child:
297:7cc868888d56
Commit message:
testing counters;

Changed in this revision

CDMS_HK.h Show annotated file Show diff for this revision Revisions of this file
ThreadsAndFunctions.h Show annotated file Show diff for this revision Revisions of this file
cdms_sd.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	Sun Aug 28 13:53:42 2016 +0000
+++ b/CDMS_HK.h	Sun Aug 28 14:47:38 2016 +0000
@@ -20,8 +20,14 @@
 
 DigitalOut SelectLinec3 (PIN79); // MSB of Select Lines
 DigitalOut SelectLinec2 (PIN78);
+DigitalOut SelectLinec1 (PIN76);
+DigitalOut SelectLinec0 (PIN77); // LSB of Select Lines
+
+/*
+Before SBC. To be restored in FM model
 DigitalOut SelectLinec1 (PIN77);
 DigitalOut SelectLinec0 (PIN76); // LSB of Select Lines
+*/
 
 Convolution CDMS_HEALTH;
 Convolution BAE_HEALTH;
@@ -64,7 +70,7 @@
     CDMS_HK_MAIN_STATUS = 0x01;
     CDMS_HK_MAIN_COUNTER++;
 
-    FCTN_CDMS_HK();//collects temperatures
+    FCTN_CDMS_HK();         //collects temperatures
     RSSI_volatge = COMRX_RSSI_volatge.read() * 3.3;//to be checked
     VERIFY_COMRX();
     VERIFY_RTC();
@@ -295,7 +301,7 @@
 
     for(Iteration=0; Iteration<16; Iteration++) {
 
-        if(Iteration<14) {
+        if(Iteration<4) {
             actual_data.temp_actual[Iteration]=actual_data.temp_actual[Iteration]*3.3;
             resistance=24000*actual_data.temp_actual[Iteration]/(3.3-actual_data.temp_actual[Iteration]);
             
@@ -551,4 +557,5 @@
     for(int i = 0; i<4; i++)
         CDMS_RAM[79+i] = FSC_LAST[5] >> i*8;
     CDMS_RAM[83] = 0x00;
+    gPC.printf("%d %d %d %d %d\n",FSC_CURRENT[1],FSC_CURRENT[2],FSC_CURRENT[3],FSC_CURRENT[4],FSC_CURRENT[5]);
 }
\ No newline at end of file
--- a/ThreadsAndFunctions.h	Sun Aug 28 13:53:42 2016 +0000
+++ b/ThreadsAndFunctions.h	Sun Aug 28 14:47:38 2016 +0000
@@ -31,6 +31,7 @@
         wait(2);/*timeout to be decided*/
         if(dma)
         {
+            PL_RCV_SC_DATA_COUNTER++;
             gPAY_SPI->bulkRead_start();
             //gPAY_SPI->bulkRead_pause();
             //gPAY_SPI->bulkRead_resume(&payload_isr_fun);
--- a/cdms_sd.h	Sun Aug 28 13:53:42 2016 +0000
+++ b/cdms_sd.h	Sun Aug 28 14:47:38 2016 +0000
@@ -647,6 +647,7 @@
 {
     // set write address for single block (CMD24)
     if (cmd(24, block_number * cdv) != 0) {
+        CDMS_WR_SD_FAULT_COUNTER++;
         return 1;
     }
     
@@ -679,6 +680,7 @@
     if ((spi.write(0xFF) & 0x1F) != 0x05) {
         cs_sd = 1;
         spi.write(0xFF);
+        CDMS_WR_SD_FAULT_COUNTER++;
         return 1;
     }
 
--- a/i2c.h	Sun Aug 28 13:53:42 2016 +0000
+++ b/i2c.h	Sun Aug 28 14:47:38 2016 +0000
@@ -55,6 +55,7 @@
     }
     else if (read_ack == 1)
     {
+        CDMS_I2C_ERR_SPEED_COUNTER++;
         I2C_busreset();
     }
     PL_I2C_GPIO = 0;
@@ -89,6 +90,7 @@
     if (write_ack == 1)
     {
         I2C_busreset();
+        CDMS_I2C_ERR_SPEED_COUNTER++;
     }
     i2c_count = 0;
     return write_ack;
@@ -121,6 +123,8 @@
     else if (read_ack == 1)
     {
         I2C_busreset();
+        CDMS_I2C_ERR_BAE_COUNTER++;
+        
     }
     CDMS_I2C_GPIO = 0;
     i2c_count = 0;
@@ -155,6 +159,7 @@
     if (write_ack == 1)
     {
         I2C_busreset();
+        CDMS_I2C_ERR_BAE_COUNTER++;
     }
     CDMS_I2C_GPIO = 0;
     i2c_count = 0;