Repository for CDMS code

Dependencies:   SimpleDMA mbed-rtos mbed eeprom

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Tue Jun 28 05:40:08 2016 +0000
Parent:
189:1140091f5cec
Commit message:
Testing SDCARD functionalities

Changed in this revision

Compression.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
--- a/Compression.h	Sun Jun 26 12:46:51 2016 +0000
+++ b/Compression.h	Tue Jun 28 05:40:08 2016 +0000
@@ -285,7 +285,7 @@
                     space = adjust(1,0,pointer,8);
                     space = adjust(4,3,pointer,space);
                     FSC_science = FCTN_SD_MNGR(3);
-                    //gPC.printf("SID = 3, FSC = %02X\r\n", FSC_science);
+                    gPC.printf("SID = 3, FSC = %02X\r\n", FSC_science);
                     frames[id][1] = (FSC_science>>24)&0xff;
                     frames[id][2] = (FSC_science>>16)&0xff;
                     frames[id][3] = (FSC_science>>8)&0xff;
@@ -300,7 +300,7 @@
                     space = adjust(4,2,pointer,space);
                     FSC_science = FCTN_SD_MNGR(2);
                     
- //                   gPC.printf("SID = 2, FSC = %02X\r\n", FSC_science);
+                    gPC.printf("SID = 2, FSC = %02X\r\n", FSC_science);
                     frames[id][1] = (FSC_science>>16)&0xff;
                     frames[id][2] = (FSC_science>>8)&0xff;
                     frames[id][3] = FSC_science&0xff;
@@ -584,7 +584,7 @@
                 space = adjust(1,0,pointer,8);
                 space = adjust(4,1,pointer,space);
                 FSC_science = FCTN_SD_MNGR(1);
-                //gPC.printf("SID = 1, FSC = %02X\r\n", FSC_science);
+                gPC.printf("SID = 1, FSC = %02X\r\n", FSC_science);
                 frames[id][1] = (FSC_science>>16)&0xff;
                 frames[id][2] = (FSC_science>>8)&0xff;
                 frames[id][3] = (FSC_science)&0xff;
--- a/cdms_sd.h	Sun Jun 26 12:46:51 2016 +0000
+++ b/cdms_sd.h	Tue Jun 28 05:40:08 2016 +0000
@@ -88,11 +88,11 @@
     uint32_t SD_MNG_SECT=7000;
     
     uint32_t fsc;
+    uint32_t temp;
     uint8_t buffer[512];
     int b=disk_read(buffer, SD_MNG_SECT);
     if(sid==0x0)
     {
-        
         fsc=(uint32_t)(buffer[0]<<24)+(uint32_t)(buffer[1]<<16)+(uint32_t)(buffer[2]<<8)+(uint32_t)buffer[3];
         uint32_t next_fsc=fsc+1;
         buffer[0]=(uint8_t) (next_fsc>>24 & 0xFF);
@@ -134,11 +134,15 @@
         buffer[15]=(uint8_t) (next_fsc & 0xFF);
         buffer[511]+=2;
         disk_write(buffer,SD_MNG_SECT);
+        disk_read(buffer, SD_MNG_SECT);
+        temp=(uint32_t)(buffer[12]<<24)+(uint32_t)(buffer[13]<<16)+(uint32_t)(buffer[14]<<8)+(uint32_t)buffer[15];
+        gPC.printf("%d %d %d",fsc,next_fsc,temp);
+        
     }
      if(sid==0x4)
     {
         fsc=(uint32_t)(buffer[16]<<24)+(uint32_t)(buffer[17]<<16)+(uint32_t)(buffer[18]<<8)+(uint32_t)buffer[19];
-        uint32_t next_fsc=fsc+1;
+        uint32_t next_fsc=fsc+1;  
         buffer[16]=(uint8_t) (next_fsc>>24 & 0xFF);
         buffer[17]=(uint8_t) (next_fsc>>16 & 0xFF);
         buffer[18]=(uint8_t) (next_fsc>>8 & 0xFF);