mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/mtd_spi_nor: fix off by one bug
The boolean expression to detect when 32 bit address mode are needed was off by one, this fixes the issue.
This commit is contained in:
parent
32ac29bd98
commit
c2e029b427
@ -482,7 +482,7 @@ static void _set_addr_width(mtd_dev_t *mtd)
|
||||
uint32_t flash_size = mtd->pages_per_sector * mtd->page_size
|
||||
* mtd->sector_count;
|
||||
|
||||
if (flash_size > 0xFFFFFF) {
|
||||
if (flash_size > (0x1UL << 24)) {
|
||||
dev->addr_width = 4;
|
||||
} else {
|
||||
dev->addr_width = 3;
|
||||
|
Loading…
Reference in New Issue
Block a user