vr1.1

Dependencies:   FreescaleIAP mbed-rtos mbed

Fork of CDMS_RTOS_v1_1 by Team Fox

Revision:
11:d6dc9074075b
Parent:
10:2c8b9ebc79e9
--- a/Flash.cpp	Sat Jul 04 10:48:18 2015 +0000
+++ b/Flash.cpp	Mon Jul 06 06:25:14 2015 +0000
@@ -1,35 +1,22 @@
 #include "mbed.h"
 #include "FreescaleIAP.h"
-
-//--------------------------------------in bae init :
+#include "Flash.h"
+#include "all_funcs.h"
 
- int strt_add = flash_size() - (4*SECTOR_SIZE); 
- 
- uint32_t flasharray[256+(3*1024)];
- 
- char *nativeflash = (char*)strt_add;
- 
- 
- //--------------------------WRITING AND READING FLASH--------------------------------------------------------------------------------//
- 
- void P_BAE_WRFLASH()
- {
-     erase_sector(strt_add);
-     program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3)));
- 
- }
- void P_BAE_RDFLASH()
- {
-     for(int64_t i=0;i<(256+(3*1024));i++)flasharray[i]=nativeflash[i];
- }
-int P_CDMS_WRITEBLOCK(int i,uint32_t block)
-{  P_BAE_RDFLASH();
+/*Writing to the Flash*/
+void FCTN_CDMS_WR_FLASH(uint16_t i,uint32_t block)
+{
+   for(int64_t i=0;i<(256+(3*1024));i++)flasharray[i]=nativeflash[i];
    flasharray[i]=block;
-   P_BAE_WRFLASH();
-   return 0;
+   erase_sector(strt_add);
+   program_flash(strt_add, (char*)&flasharray,4*(256+(1024*3)));
 }
+/*End*/
 
-uint32_t P_CDMS_READBLOCK(int i)
-{  P_BAE_RDFLASH();
+/*Reading from Flash*/
+uint32_t FCTN_CDMS_RD_FLASH(uint16_t i)
+{
+   for(int64_t i=0;i<(256+(3*1024));i++)flasharray[i]=nativeflash[i];
    return flasharray[i];
-}
\ No newline at end of file
+}
+/*End*/
\ No newline at end of file