From c2f69f4d1ee5108d325860f8b7cfb2c580ee3743 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Sun, 12 Jun 2022 16:55:44 +0100 Subject: [PATCH] stm32: simplify flash size calculation Can't use the new header here (this is C code), but can definitly do better than something that expands to inline assembly --- 32blit-stm32/Inc/quadspi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/32blit-stm32/Inc/quadspi.h b/32blit-stm32/Inc/quadspi.h index 81b7bd79a..3e9e69bfc 100644 --- a/32blit-stm32/Inc/quadspi.h +++ b/32blit-stm32/Inc/quadspi.h @@ -36,7 +36,7 @@ extern QSPI_HandleTypeDef hqspi; #define APPLICATION_ADDRESS QSPI_BASE // Flash example -#define QSPI_FLASH_SIZE POSITION_VAL(0x2000000)-1 +#define QSPI_FLASH_SIZE __builtin_ctz(0x2000000)-1 #define QSPI_PAGE_SIZE 256 /* Reset Operations */