Merge pull request #1626 from armink/fix_sfud

[DeviceDriver][sfud] Fix block erase 0 byte issue when start address …
This commit is contained in:
Bernard Xiong 2018-07-14 21:34:15 +08:00 committed by GitHub
commit 62c6205bc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;