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: mbed mbed-rtos SimpleDMA FreescaleIAP eeprom
Fork of CDMS_CODE_FM_28JAN2017 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*/
