From 64126d628fe4b6e49bcd143f199710c40115817a Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 27 May 2018 02:28:32 -0400 Subject: Convert FMC I/O functions to static inline. fmc_read_32() and fmc_write_32() get called often enough that it's worth eliminating unnecessary function call overhead. --- stm-fmc.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'stm-fmc.h') diff --git a/stm-fmc.h b/stm-fmc.h index d0f8bb4..86e83d9 100644 --- a/stm-fmc.h +++ b/stm-fmc.h @@ -57,7 +57,61 @@ extern void fmc_init(void); -extern HAL_StatusTypeDef fmc_write_32(uint32_t addr, uint32_t *data); -extern HAL_StatusTypeDef fmc_read_32(uint32_t addr, uint32_t *data); + +static inline HAL_StatusTypeDef _fmc_nwait_idle(void) +{ + int cnt; + + // poll NWAIT (number of iterations is limited) + for (cnt=0; cnt