Skip to content

Commit 2b99003

Browse files
committed
stm32/boards/STM32F769DISC: Use macro instead of const for flash size.
So that the flash size can be changed in just one place. Also remove the duplicate cache entry.
1 parent 1ae8618 commit 2b99003

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

ports/stm32/boards/STM32F769DISC/board_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const mp_spiflash_config_t spiflash_config = {
99
.bus_kind = MP_SPIFLASH_BUS_QSPI,
1010
.bus.u_qspi.data = NULL,
1111
.bus.u_qspi.proto = &qspi_proto,
12-
.cache = NULL,
1312
.cache = &spi_bdev_cache,
1413
};
1514

ports/stm32/boards/STM32F769DISC/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern struct _spi_bdev_t spi_bdev;
4141
#if !USE_QSPI_XIP
4242
#define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0)
4343
#define MICROPY_HW_BDEV_IOCTL(op, arg) ( \
44-
(op) == BDEV_IOCTL_NUM_BLOCKS ? (64 * 1024 * 1024 / FLASH_BLOCK_SIZE) : \
44+
(op) == BDEV_IOCTL_NUM_BLOCKS ? ((1 << MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2) / 8 / FLASH_BLOCK_SIZE) : \
4545
(op) == BDEV_IOCTL_INIT ? spi_bdev_ioctl(&spi_bdev, (op), (uint32_t)&spiflash_config) : \
4646
spi_bdev_ioctl(&spi_bdev, (op), (arg)) \
4747
)

0 commit comments

Comments
 (0)