pl ack in tmtc

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of COM_MNG_TMTC_SIMPLE_pl123 by shubham c

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Flash.h Source File

Flash.h

00001 #include "FreescaleIAP.h"
00002 
00003 int strt_add = flash_size() - (4*SECTOR_SIZE);  
00004 uint32_t flasharray[256+(3*1024)];
00005 char *nativeflash = (char*)strt_add;
00006 
00007 /*Writing to the Flash*/
00008 void FCTN_CDMS_WR_FLASH(uint16_t j,uint32_t block)
00009 {
00010     for(int64_t i=0;i<(256+(3*1024));i++)
00011     {
00012         flasharray[i]=nativeflash[i];
00013     }
00014     flasharray[j]=block;
00015     erase_sector(strt_add);
00016     program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3)));
00017 }
00018 /*End*/
00019 
00020 /*Reading from Flash*/
00021 uint32_t FCTN_CDMS_RD_FLASH(uint16_t j)
00022 {
00023     for(int64_t i=0;i<(256+(3*1024));i++)
00024     {
00025         flasharray[i]=nativeflash[i];
00026     }
00027     return flasharray[j];
00028 }