Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed-rtos SimpleDMA FreescaleIAP eeprom
Fork of CDMS_CODE_FM_28JAN2017 by
Diff: Flash.h
- Revision:
- 255:642ea552ac77
- Parent:
- 52:0bd68655c651
diff -r c766afa330a3 -r 642ea552ac77 Flash.h
--- a/Flash.h Mon Jul 11 12:30:41 2016 +0000
+++ b/Flash.h Mon Jul 11 14:33:02 2016 +0000
@@ -25,4 +25,20 @@
flasharray[i]=nativeflash[i];
}
return flasharray[j];
-}
\ No newline at end of file
+}
+
+/*===================================================MMS Functions=================================================*/
+
+void WRITE_TO_FLASH(uint8_t *);
+
+void WRITE_TO_FLASH(uint8_t *flash)
+{
+ uint32_t FLASH[5];
+ FLASH[0] = ((uint32_t)flash[0] << 24) | ((uint32_t)flash[1] << 16) | ((uint32_t)flash[2] << 8) | ((uint32_t)flash[3]);
+ FLASH[1] = ((uint32_t)flash[4] << 24) | ((uint32_t)flash[5] << 16) | ((uint32_t)flash[6] << 8) | ((uint32_t)flash[7]);
+ FLASH[2] = ((uint32_t)flash[8] << 24) | ((uint32_t)flash[9] << 16) | ((uint32_t)flash[10] << 8) | ((uint32_t)flash[11]);
+ FLASH[3] = ((uint32_t)flash[12] << 24) | ((uint32_t)flash[13] << 16) | ((uint32_t)flash[14] << 8) | ((uint32_t)flash[15]);
+ FLASH[4] = ((uint32_t)flash[16] << 24) | ((uint32_t)flash[17] << 16) | ((uint32_t)flash[18] << 8) | ((uint32_t)flash[19]);
+ erase_sector(strt_add);
+ program_flash(strt_add, (char*)FLASH,160);
+}
