Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreescaleIAP SimpleDMA mbed-rtos mbed
Fork of CDMS_CODE by
Flash.h
- Committer:
- ee12b079
- Date:
- 2016-01-07
- Revision:
- 35:3beac900a034
- Child:
- 208:d14b1c783736
- Child:
- 214:6848a51af734
- Child:
- 248:407ab7e337cd
- Child:
- 255:642ea552ac77
- Child:
- 257:7d404e9dc9e2
File content as of revision 35:3beac900a034:
#include "FreescaleIAP.h"
int strt_add = flash_size() - (4*SECTOR_SIZE);
uint32_t flasharray[256+(3*1024)];
char *nativeflash = (char*)strt_add;
/*Writing to the Flash*/
void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t block)
{
for(int64_t i=0;i<(256+(3*1024));i++)
{
flasharray[i]=nativeflash[i];
}
flasharray[j]=block;
erase_sector(strt_add);
program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3)));
}
/*End*/
/*Reading from Flash*/
uint32_t FCTN_CDMS_RD_FLASH(uint16_t j)
{
for(int64_t i=0;i<(256+(3*1024));i++)
{
flasharray[i]=nativeflash[i];
}
return flasharray[j];
}
