working version
Dependencies: mbed mbed-rtos SimpleDMA FreescaleIAP eeprom
Fork of CDMS_CODE_FM_28JAN2017 by
Diff: cdms_sd.h
- Revision:
- 190:3b924ffa4d19
- Parent:
- 174:44a6d7c7674c
--- 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);