From 050488000327b04d6b73b63f4735a5c8482e8e2c Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 20 Feb 2019 17:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=88=A0=E9=99=A4=E3=80=91=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E6=96=AD=E8=A8=80=E6=A3=80=E6=9F=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- demo/env/stm32f10x/non_os/components/easyflash/port/ef_port.c | 4 ---- .../non_os_spi_flash/components/easyflash/port/ef_port.c | 4 ---- demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c | 4 ---- 3 files changed, 12 deletions(-) diff --git a/demo/env/stm32f10x/non_os/components/easyflash/port/ef_port.c b/demo/env/stm32f10x/non_os/components/easyflash/port/ef_port.c index 1a12f70..d8f16be 100644 --- a/demo/env/stm32f10x/non_os/components/easyflash/port/ef_port.c +++ b/demo/env/stm32f10x/non_os/components/easyflash/port/ef_port.c @@ -74,8 +74,6 @@ EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size) { uint8_t *buf_8 = (uint8_t *)buf; size_t i; - EF_ASSERT(addr % 4 == 0); - /*copy from flash to ram */ for (i = 0; i < size; i++, addr ++, buf_8++) { *buf_8 = *(uint8_t *) addr; @@ -138,8 +136,6 @@ EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) { size_t i; uint32_t read_data; - EF_ASSERT(addr % 4 == 0); - FLASH_Unlock(); FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); for (i = 0; i < size; i += 4, buf++, addr += 4) { diff --git a/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/port/ef_port.c b/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/port/ef_port.c index 6d6557f..4e12a8d 100644 --- a/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/port/ef_port.c +++ b/demo/env/stm32f10x/non_os_spi_flash/components/easyflash/port/ef_port.c @@ -77,8 +77,6 @@ EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size) { EfErrCode result = EF_NO_ERR; const sfud_flash *flash = sfud_get_device_table() + SFUD_SST25_DEVICE_INDEX; - EF_ASSERT(size % 4 == 0); - sfud_read(flash, addr, size, (uint8_t *)buf); return result; @@ -126,8 +124,6 @@ EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) { sfud_err sfud_result = SFUD_SUCCESS; const sfud_flash *flash = sfud_get_device_table() + SFUD_SST25_DEVICE_INDEX; - EF_ASSERT(size % 4 == 0); - sfud_result = sfud_write(flash, addr, size, (const uint8_t *)buf); if(sfud_result != SFUD_SUCCESS) { diff --git a/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c b/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c index 2f404be..8f17ad9 100644 --- a/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c +++ b/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c @@ -77,8 +77,6 @@ EfErrCode ef_port_read(uint32_t addr, uint32_t *buf, size_t size) { uint8_t *buf_8 = (uint8_t *)buf; size_t i; - EF_ASSERT(addr % 4 == 0); - /*copy from flash to ram */ for (i = 0; i < size; i++, addr ++, buf_8++) { *buf_8 = *(uint8_t *) addr; @@ -141,8 +139,6 @@ EfErrCode ef_port_write(uint32_t addr, const uint32_t *buf, size_t size) { size_t i; uint32_t read_data; - EF_ASSERT(addr % 4 == 0); - FLASH_Unlock(); FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); for (i = 0; i < size; i += 4, buf++, addr += 4) {