flash codes for reading or writing 20 bytes into the last sector of the flash area
Dependencies: FreescaleIAP mbed
Flash.cpp@0:be957fac28c5, 2016-03-03 (annotated)
- Committer:
- raizel_varun
- Date:
- Thu Mar 03 04:43:15 2016 +0000
- Revision:
- 0:be957fac28c5
- Child:
- 1:2f1e120d6f75
flash direct use files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
raizel_varun | 0:be957fac28c5 | 1 | #include "mbed.h" |
raizel_varun | 0:be957fac28c5 | 2 | #include "FreescaleIAP.h" |
raizel_varun | 0:be957fac28c5 | 3 | #include "Flash.h" |
raizel_varun | 0:be957fac28c5 | 4 | #include "all_funcs.h" |
raizel_varun | 0:be957fac28c5 | 5 | |
raizel_varun | 0:be957fac28c5 | 6 | /*Writing to the Flash*/ |
raizel_varun | 0:be957fac28c5 | 7 | void FCTN_CDMS_WR_FLASH() |
raizel_varun | 0:be957fac28c5 | 8 | { |
raizel_varun | 0:be957fac28c5 | 9 | for(int8_t i=0;i<(20);i++)flasharray[i]=nativeflash[i]; |
raizel_varun | 0:be957fac28c5 | 10 | flasharray[i]=block; |
raizel_varun | 0:be957fac28c5 | 11 | erase_sector(strt_add); |
raizel_varun | 0:be957fac28c5 | 12 | program_flash(strt_add, (char*)&flasharray,20); |
raizel_varun | 0:be957fac28c5 | 13 | } |
raizel_varun | 0:be957fac28c5 | 14 | /*End*/ |
raizel_varun | 0:be957fac28c5 | 15 | |
raizel_varun | 0:be957fac28c5 | 16 | /*Reading from Flash*/ |
raizel_varun | 0:be957fac28c5 | 17 | uint32_t FCTN_CDMS_RD_FLASH(uint16_t i) |
raizel_varun | 0:be957fac28c5 | 18 | { |
raizel_varun | 0:be957fac28c5 | 19 | for(int8_t i=0;i<(20);i++)flasharray[i]=nativeflash[i]; |
raizel_varun | 0:be957fac28c5 | 20 | return flasharray[i]; |
raizel_varun | 0:be957fac28c5 | 21 | } |
raizel_varun | 0:be957fac28c5 | 22 | /*End*/ |