From 0b84e93734a0ec416c803fdce876d88ef1b2bb69 Mon Sep 17 00:00:00 2001 From: Ein Terakawa Date: Sat, 3 Apr 2021 10:38:49 +0900 Subject: [PATCH] Follow-up fix to alexclewontin's nuc123-kvs-example --- os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c | 10 ++++++---- .../NUC123/NUTINY-SDK-NUC123-V2.0/EFL/cfg/mcuconf.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c b/os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c index fed4e16f..5e9341ac 100644 --- a/os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c +++ b/os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c @@ -49,8 +49,10 @@ #define NUC123_EFL_CMD_CHIPERASE 0x26UL /* Undocumented */ #if ((NUC123_CONFIG_ENABLED == FALSE) || (NUC123_EFL_ACCESS_CONFIG == TRUE)) && \ - (NUC123_EFL_ACCESS_APROM == TRUE) && (NUC123_EFL_ACCESS_DATAFLASH == TRUE) + (NUC123_EFL_ACCESS_APROM == TRUE) || (NUC123_EFL_ACCESS_DATAFLASH == TRUE) #define NUC123_EFL_DYNAMICALLY_CHECK_CONFIG TRUE +#else +#define NUC123_EFL_DYNAMICALLY_CHECK_CONFIG FALSE #endif /*===========================================================================*/ @@ -166,7 +168,7 @@ void efl_lld_start(EFlashDriver* eflp) FMC->FATCON |= FMC_FATCON_MFOM_Msk; #endif -#if (NUC123_EFL_ACCESS_APROM == TRUE) || (NUC123_EFL_ACCESS_DATAFLASH == TRUE) +#if (NUC123_EFL_ACCESS_APROM == TRUE) ispcon |= FMC_ISPCON_APUEN_Msk; #endif @@ -200,7 +202,7 @@ void efl_lld_stop(EFlashDriver* eflp) ispcon &= ~FMC_ISPCON_ISPEN_Msk; /* Disables the peripheral.*/ -#if (NUC123_EFL_ACCESS_APROM == TRUE) || (NUC123_EFL_ACCESS_DATAFLASH == TRUE) +#if (NUC123_EFL_ACCESS_APROM == TRUE) ispcon &= ~FMC_ISPCON_APUEN_Msk; #endif #if (NUC123_EFL_ACCESS_LDROM == TRUE) @@ -261,7 +263,7 @@ const flash_descriptor_t* efl_lld_get_descriptor(void* instance) #else dataflash_size = NUC123_CONFIG_DATAFLASH_SIZE; - dfbaddr = NUC123_DFBADDR; + dfbaddr = (void *)NUC123_DFBADDR; #endif diff --git a/testhal/NUMICRO/NUC123/NUTINY-SDK-NUC123-V2.0/EFL/cfg/mcuconf.h b/testhal/NUMICRO/NUC123/NUTINY-SDK-NUC123-V2.0/EFL/cfg/mcuconf.h index 08642c6b..64e270c5 100644 --- a/testhal/NUMICRO/NUC123/NUTINY-SDK-NUC123-V2.0/EFL/cfg/mcuconf.h +++ b/testhal/NUMICRO/NUC123/NUTINY-SDK-NUC123-V2.0/EFL/cfg/mcuconf.h @@ -30,8 +30,8 @@ #define NUC123_SERIAL_CLKSRC NUC123_SERIAL_CLKSRC_HSI #define NUC123_CONFIG_ENABLED TRUE -#define NUC123_DATAFLASH_ENABLED TRUE -#define NUC123_DATAFLASH_SIZE 4096 +#define NUC123_CONFIG_DATAFLASH_ENABLED TRUE +#define NUC123_CONFIG_DATAFLASH_SIZE 4096 #define NUC123_EFL_ACCESS_APROM TRUE #define NUC123_EFL_ACCESS_DATAFLASH TRUE #define NUC123_EFL_ACCESS_LDROM TRUE