mirror of
https://gitee.com/Armink/EasyFlash.git
synced 2024-12-01 19:58:43 +08:00
【删除】多余的断言检查。
Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
03095fb2e3
commit
0504880003
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user