
CDMS code for testing sbc
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Diff: Flash.h
- Revision:
- 248:407ab7e337cd
- Parent:
- 52:0bd68655c651
- Child:
- 249:1560c64adffb
--- a/Flash.h Wed Jul 06 08:09:22 2016 +0000 +++ b/Flash.h Fri Jul 08 12:53:24 2016 +0000 @@ -1,28 +1,33 @@ #include "FreescaleIAP.h" -int strt_add = flash_size() - (4*SECTOR_SIZE); -uint32_t flasharray[256+(3*1024)]; -char *nativeflash = (char*)strt_add; +int strt_add = flash_size() - (2*SECTOR_SIZE); +uint32_t flasharray[8]; //256+(3*1024) +/*corrected*/ +int *nativeflash = (int*)strt_add; /*Writing to the Flash*/ -void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t block) +void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t fdata) //j-position to write address ; fdata - flash data to be written { - for(int64_t i=0;i<(256+(3*1024));i++) + for(int i=0;i<8;i++) { flasharray[i]=nativeflash[i]; } - flasharray[j]=block; + flasharray[j]=fdata; erase_sector(strt_add); - program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3))); + program_flash(strt_add, (char*)flasharray,32); } + /*End*/ /*Reading from Flash*/ -uint32_t FCTN_CDMS_RD_FLASH(uint16_t j) + +uint32_t* FCTN_BAE_RD_FLASH() { - for(int64_t i=0;i<(256+(3*1024));i++) + for(int i=0;i<8;i++) { flasharray[i]=nativeflash[i]; } - return flasharray[j]; -} \ No newline at end of file + return flasharray; +} + +/*End*/