
Repository for CDMS code
Dependencies: SimpleDMA mbed-rtos mbed eeprom
Fork of COM_MNG_TMTC_SIMPLE by
Flash.h@199:9f03d6ca94c9, 2016-06-30 (annotated)
- Committer:
- ee12b079
- Date:
- Thu Jun 30 21:38:54 2016 +0000
- Revision:
- 199:9f03d6ca94c9
- Parent:
- 52:0bd68655c651
- Child:
- 208:d14b1c783736
- Child:
- 214:6848a51af734
- Child:
- 248:407ab7e337cd
- Child:
- 255:642ea552ac77
- Child:
- 257:7d404e9dc9e2
obsrs tm to be checked
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
aniruddhv | 52:0bd68655c651 | 1 | #include "FreescaleIAP.h" |
aniruddhv | 52:0bd68655c651 | 2 | |
aniruddhv | 52:0bd68655c651 | 3 | int strt_add = flash_size() - (4*SECTOR_SIZE); |
aniruddhv | 52:0bd68655c651 | 4 | uint32_t flasharray[256+(3*1024)]; |
aniruddhv | 52:0bd68655c651 | 5 | char *nativeflash = (char*)strt_add; |
aniruddhv | 52:0bd68655c651 | 6 | |
aniruddhv | 52:0bd68655c651 | 7 | /*Writing to the Flash*/ |
aniruddhv | 52:0bd68655c651 | 8 | void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t block) |
aniruddhv | 52:0bd68655c651 | 9 | { |
aniruddhv | 52:0bd68655c651 | 10 | for(int64_t i=0;i<(256+(3*1024));i++) |
aniruddhv | 52:0bd68655c651 | 11 | { |
aniruddhv | 52:0bd68655c651 | 12 | flasharray[i]=nativeflash[i]; |
aniruddhv | 52:0bd68655c651 | 13 | } |
aniruddhv | 52:0bd68655c651 | 14 | flasharray[j]=block; |
aniruddhv | 52:0bd68655c651 | 15 | erase_sector(strt_add); |
aniruddhv | 52:0bd68655c651 | 16 | program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3))); |
aniruddhv | 52:0bd68655c651 | 17 | } |
aniruddhv | 52:0bd68655c651 | 18 | /*End*/ |
aniruddhv | 52:0bd68655c651 | 19 | |
aniruddhv | 52:0bd68655c651 | 20 | /*Reading from Flash*/ |
aniruddhv | 52:0bd68655c651 | 21 | uint32_t FCTN_CDMS_RD_FLASH(uint16_t j) |
aniruddhv | 52:0bd68655c651 | 22 | { |
aniruddhv | 52:0bd68655c651 | 23 | for(int64_t i=0;i<(256+(3*1024));i++) |
aniruddhv | 52:0bd68655c651 | 24 | { |
aniruddhv | 52:0bd68655c651 | 25 | flasharray[i]=nativeflash[i]; |
aniruddhv | 52:0bd68655c651 | 26 | } |
aniruddhv | 52:0bd68655c651 | 27 | return flasharray[j]; |
aniruddhv | 52:0bd68655c651 | 28 | } |