pl ack in tmtc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE_pl123 by shubham c

Committer:
pradeepvk2208
Date:
Sat Apr 02 04:17:20 2016 +0000
Revision:
140:4feeb1163bb6
Parent:
52:0bd68655c651
included ack for pl_tc_tm

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 }