From 4d6b66214946b765040d7541055f9ae1e7dd53c2 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 28 Jun 2018 16:09:42 -0500 Subject: [PATCH] ext: hal: cypress: Protect floating point code with CONFIG_FLOAT There is a little bit of floating point code in cy_sysclk.c. For now add compile protection for this code using CONFIG_FLOAT. This code utilizes some libm functions like ceil(). So if / when the functions Cy_SysClk_EcoConfigure & Cy_SysClk_FllConfigure are needed we'll also new to probably pull in newlib. Signed-off-by: Kumar Gala --- ext/hal/cypress/PDL/3.1.0/drivers/source/cy_sysclk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/hal/cypress/PDL/3.1.0/drivers/source/cy_sysclk.c b/ext/hal/cypress/PDL/3.1.0/drivers/source/cy_sysclk.c index c51c9a494c6..c318ed5a547 100644 --- a/ext/hal/cypress/PDL/3.1.0/drivers/source/cy_sysclk.c +++ b/ext/hal/cypress/PDL/3.1.0/drivers/source/cy_sysclk.c @@ -16,7 +16,9 @@ #include "cy_sysclk.h" #include "cy_syslib.h" +#ifdef CONFIG_FLOAT #include +#endif #include #if defined(__cplusplus) @@ -33,6 +35,7 @@ extern "C" { * \addtogroup group_sysclk_eco_funcs * \{ */ +#ifdef CONFIG_FLOAT /******************************************************************************* * Function Name: Cy_SysClk_EcoConfigure ****************************************************************************//** @@ -203,6 +206,7 @@ cy_en_sysclk_status_t Cy_SysClk_EcoEnable(uint32_t timeoutus) return (rtnval); } /** \} group_sysclk_eco_funcs */ +#endif /* CONFIG_FLOAT */ /* ========================================================================== */ @@ -329,6 +333,7 @@ cy_en_clkpath_in_sources_t Cy_SysClk_ClkPathGetSource(uint32_t clkPath) * \snippet sysclk/sysclk_v1_10_sut_01.cydsn/main_cm4.c snippet_Cy_SysClk_FllConfigure * *******************************************************************************/ +#ifdef CONFIG_FLOAT cy_en_sysclk_status_t Cy_SysClk_FllConfigure(uint32_t inputFreq, uint32_t outputFreq, cy_en_fll_pll_output_mode_t outputMode) { cy_en_sysclk_status_t returnStatus = CY_SYSCLK_SUCCESS; @@ -448,6 +453,7 @@ cy_en_sysclk_status_t Cy_SysClk_FllConfigure(uint32_t inputFreq, uint32_t output return (returnStatus); } +#endif /******************************************************************************* * Function Name: Cy_SysClk_FllManualConfigure