Latest FM Code with EEPROM
Dependencies: FreescaleIAP SimpleDMA eeprom mbed-rtos mbed
Fork of CDMS_QM_03MAR2017_Flash_with_obsrs by
Diff: cdms_sd.h
- Revision:
- 356:4484bf39526f
- Parent:
- 354:eb6c863756a8
--- a/cdms_sd.h Tue Mar 28 08:50:07 2017 +0000 +++ b/cdms_sd.h Sat Feb 24 10:28:56 2018 +0000 @@ -22,10 +22,10 @@ uint32_t SD_SCP_FIRST=10001; uint32_t SD_SCP_LAST=20000; -uint32_t SD_SFF_AT_FIRST=20001; -uint32_t SD_SFF_AT_LAST = 30000; -uint32_t SD_SFF_BT_FIRST =30001; -uint32_t SD_SFF_BT_LAST=40000; +uint32_t SD_SFF_AT_FIRST=30001; +uint32_t SD_SFF_AT_LAST = 40000; +uint32_t SD_SFF_BT_FIRST =20001; +uint32_t SD_SFF_BT_LAST=30000; uint32_t SD_HK_ARCH_FIRST=40001; uint32_t SD_HK_ARCH_LAST= 50000; uint32_t LOG_FIRST =50001; @@ -133,7 +133,7 @@ if(SD_MNG_SECT != SD_LIB_BLK_CURRENT) { SD_LIB_BLK_CURRENT = SD_MNG_SECT; - FCTN_CDMS_WR_FLASH(16,SD_LIB_BLK_CURRENT); + WRITE_TO_EEPROM(16,SD_LIB_BLK_CURRENT); } SD_LIB_WRITES = SD_LIB_WRITES%(int)0xFFFF; disk_write(buffer,SD_MNG_SECT); @@ -327,7 +327,7 @@ } if(sid==0x05) { - block_number= LOG_FIRST +(fsc%(LOG_FIRST - LOG_FIRST +1))-1; + block_number= LOG_FIRST +(fsc%(LOG_LAST - LOG_FIRST +1))-1; //block_number= LOG_FIRST +fsc; result= disk_write(buffer,block_number); if(result == 0) @@ -385,7 +385,7 @@ if(!(FSC_OLD[5]<=fsc && fsc<=FSC_CURRENT[5])){ return 0x86; } - block_number= LOG_FIRST +(fsc%(LOG_FIRST - LOG_FIRST +1))-1; + block_number= LOG_FIRST +(fsc%(LOG_LAST - LOG_FIRST +1))-1; result= disk_read(buffer,block_number); } else