Skip to content

Commit

Permalink
Merge pull request #270 from elfmimi/nuc123-efl-fix
Browse files Browse the repository at this point in the history
Follow-up fix to alexclewontin's nuc123-kvs-example
  • Loading branch information
elfmimi committed Apr 8, 2021
2 parents b387cc8 + 6747713 commit fe3cdf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions os/hal/ports/NUMICRO/LLD/FLASHv1/hal_efl_lld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*===========================================================================*/
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe3cdf8

Please sign in to comment.