diff options
author | Damien George <damien.p.george@gmail.com> | 2020-06-12 10:15:25 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-06-12 10:28:26 +1000 |
commit | 2b9900380ad2d0ab232e5e3a93c64aaddf90c55a (patch) | |
tree | 306e410e527d2b6d1c99f919391c8da2744a1573 | |
parent | 1ae861819dbe8a57cdfda882b093d8d564d8f1c9 (diff) |
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.
-rw-r--r-- | ports/stm32/boards/STM32F769DISC/board_init.c | 1 | ||||
-rw-r--r-- | ports/stm32/boards/STM32F769DISC/mpconfigboard.h | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/ports/stm32/boards/STM32F769DISC/board_init.c b/ports/stm32/boards/STM32F769DISC/board_init.c index 67fad407a..6bb3dfb1f 100644 --- a/ports/stm32/boards/STM32F769DISC/board_init.c +++ b/ports/stm32/boards/STM32F769DISC/board_init.c @@ -9,7 +9,6 @@ const mp_spiflash_config_t spiflash_config = { .bus_kind = MP_SPIFLASH_BUS_QSPI, .bus.u_qspi.data = NULL, .bus.u_qspi.proto = &qspi_proto, - .cache = NULL, .cache = &spi_bdev_cache, }; diff --git a/ports/stm32/boards/STM32F769DISC/mpconfigboard.h b/ports/stm32/boards/STM32F769DISC/mpconfigboard.h index 8dbac2d01..e1fe93bb0 100644 --- a/ports/stm32/boards/STM32F769DISC/mpconfigboard.h +++ b/ports/stm32/boards/STM32F769DISC/mpconfigboard.h @@ -41,7 +41,7 @@ extern struct _spi_bdev_t spi_bdev; #if !USE_QSPI_XIP #define MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE (0) #define MICROPY_HW_BDEV_IOCTL(op, arg) ( \ - (op) == BDEV_IOCTL_NUM_BLOCKS ? (64 * 1024 * 1024 / FLASH_BLOCK_SIZE) : \ + (op) == BDEV_IOCTL_NUM_BLOCKS ? ((1 << MICROPY_HW_QSPIFLASH_SIZE_BITS_LOG2) / 8 / FLASH_BLOCK_SIZE) : \ (op) == BDEV_IOCTL_INIT ? spi_bdev_ioctl(&spi_bdev, (op), (uint32_t)&spiflash_config) : \ spi_bdev_ioctl(&spi_bdev, (op), (arg)) \ ) |