sd 32 update

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Committer:
pradeepvk2208
Date:
Tue Jan 19 12:29:15 2016 +0000
Revision:
72:7460872eef79
Parent:
52:0bd68655c651
sd update 32

Who changed what in which revision?

UserRevisionLine numberNew 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 }