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 <kumar.gala@linaro.org>
This commit is contained in:
parent
2aa3815a09
commit
4d6b662149
1 changed files with 6 additions and 0 deletions
|
@ -16,7 +16,9 @@
|
||||||
|
|
||||||
#include "cy_sysclk.h"
|
#include "cy_sysclk.h"
|
||||||
#include "cy_syslib.h"
|
#include "cy_syslib.h"
|
||||||
|
#ifdef CONFIG_FLOAT
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
@ -33,6 +35,7 @@ extern "C" {
|
||||||
* \addtogroup group_sysclk_eco_funcs
|
* \addtogroup group_sysclk_eco_funcs
|
||||||
* \{
|
* \{
|
||||||
*/
|
*/
|
||||||
|
#ifdef CONFIG_FLOAT
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Function Name: Cy_SysClk_EcoConfigure
|
* Function Name: Cy_SysClk_EcoConfigure
|
||||||
****************************************************************************//**
|
****************************************************************************//**
|
||||||
|
@ -203,6 +206,7 @@ cy_en_sysclk_status_t Cy_SysClk_EcoEnable(uint32_t timeoutus)
|
||||||
return (rtnval);
|
return (rtnval);
|
||||||
}
|
}
|
||||||
/** \} group_sysclk_eco_funcs */
|
/** \} 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
|
* \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 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;
|
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);
|
return (returnStatus);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Function Name: Cy_SysClk_FllManualConfigure
|
* Function Name: Cy_SysClk_FllManualConfigure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue