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.
pull/6084/head
Damien George 2020-06-12 10:15:25 +10:00
rodzic 1ae861819d
commit 2b9900380a
2 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -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,
};

Wyświetl plik

@ -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)) \
)