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.
Fork of mbed-dev by
Diff: targets/TARGET_Realtek/TARGET_AMEBA/flash_ext.c
- Revision:
- 170:19eb464bc2be
- Parent:
- 168:9672193075cf
--- a/targets/TARGET_Realtek/TARGET_AMEBA/flash_ext.c Wed Jul 19 17:31:21 2017 +0100
+++ b/targets/TARGET_Realtek/TARGET_AMEBA/flash_ext.c Thu Aug 03 13:13:39 2017 +0100
@@ -128,7 +128,7 @@
__flash_ext_turnon();
SpicWaitWipDoneRefinedRtl8195A(flashobj.SpicInitPara);
-
+
offset = addr & 0x03;
addr = addr & ~0x03;
pbuf = data;
@@ -189,13 +189,13 @@
uint32_t i, offset, word;
const uint8_t*pbuf;
uint8_t *ptr;
- u8 flashtype = 0;
+ u8 flashtype = 0;
offset = addr & 0x03;
addr = addr & ~0x03;
pbuf = data;
flashtype = flashobj.SpicInitPara.flashtype;
-
+
if (offset != 0) {
word = HAL_READ32(SPI_FLASH_BASE, addr);
ptr = (uint8_t *)&word + offset;
@@ -207,7 +207,7 @@
}
HAL_WRITE32(SPI_FLASH_BASE, addr, word);
SpicWaitBusyDoneRtl8195A();
-
+
if(flashtype == FLASH_MICRON){
SpicWaitOperationDoneRtl8195A(flashobj.SpicInitPara);
} else {
@@ -222,7 +222,7 @@
((uint32_t)(*(pbuf+2)) << 16) | ((uint32_t)(*(pbuf+3)) << 24);
HAL_WRITE32(SPI_FLASH_BASE, addr, word);
SpicWaitBusyDoneRtl8195A();
-
+
if(flashtype == FLASH_MICRON){
SpicWaitOperationDoneRtl8195A(flashobj.SpicInitPara);
} else {
@@ -237,7 +237,7 @@
while (len >= 4) {
HAL_WRITE32(SPI_FLASH_BASE, addr, (uint32_t)*((uint32_t *)pbuf));
SpicWaitBusyDoneRtl8195A();
-
+
if(flashtype == FLASH_MICRON){
SpicWaitOperationDoneRtl8195A(flashobj.SpicInitPara);
} else {
@@ -260,7 +260,7 @@
HAL_WRITE32(SPI_FLASH_BASE, addr, word);
SpicWaitBusyDoneRtl8195A();
-
+
if(flashtype == FLASH_MICRON){
SpicWaitOperationDoneRtl8195A(flashobj.SpicInitPara);
} else {
@@ -271,7 +271,7 @@
return 0;
}
-int flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *data)
+int flash_ext_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const uint8_t *data)
{
int32_t status;
@@ -287,7 +287,7 @@
return flash_ext_stream_read(obj, addr, len, data);
}
-int flash_stream_write(flash_t *obj, uint32_t addr, uint32_t len, uint8_t *data)
+int flash_stream_write(flash_t *obj, uint32_t addr, uint32_t len, const uint8_t *data)
{
return flash_ext_stream_write(obj, addr, len, data);
}
@@ -308,7 +308,7 @@
*/
int flash_ext_burst_write(flash_t *obj, uint32_t address ,uint32_t length, uint8_t *data)
-{
+{
u32 OccuSize;
u32 ProgramSize;
u32 PageSize;
@@ -340,7 +340,7 @@
}
address += ProgramSize;
- data += ProgramSize;
+ data += ProgramSize;
length -= ProgramSize;
OccuSize = 0;
} else{
@@ -435,7 +435,7 @@
void flash_ext_reset_status(flash_t *obj)
{
__flash_ext_turnon();
- SpicSetFlashStatusRefinedRtl8195A(0, flashobj.SpicInitPara);
+ SpicSetFlashStatusRefinedRtl8195A(0, flashobj.SpicInitPara);
SpicWaitWipDoneRefinedRtl8195A(flashobj.SpicInitPara);
__flash_ext_turnoff();
}
