[DeviceDriver][sfud] Fix block erase 0 byte issue when start address is equal end address.

This commit is contained in:
armink 2018-07-14 21:01:38 +08:00
parent e751fc9934
commit e1c612bf0a
1 changed files with 4 additions and 0 deletions

View File

@ -76,6 +76,10 @@ static rt_err_t rt_sfud_control(rt_device_t dev, int cmd, void *args) {
return -RT_ERROR;
}
if (end_addr == start_addr) {
end_addr ++;
}
phy_start_addr = start_addr * rtt_dev->geometry.bytes_per_sector;
phy_size = (end_addr - start_addr) * rtt_dev->geometry.bytes_per_sector;