Minor updates to BSP init for clarity

pull/11367/head
Ryan Morse 2019-08-25 21:12:26 +01:00 committed by Kyle Kearney
parent 85dd8d704b
commit 0164ddcc80
7 changed files with 54 additions and 31 deletions

View File

@ -34,10 +34,15 @@ extern "C" {
cy_rslt_t cybsp_init(void) cy_rslt_t cybsp_init(void)
{ {
cy_rslt_t result = CY_RSLT_SUCCESS; cy_rslt_t result;
result = cyhal_hwmgr_init();
init_cycfg_system(); init_cycfg_system();
result = cybsp_register_sysclk_pm_callback();
if (CY_RSLT_SUCCESS == result)
{
result = cybsp_register_sysclk_pm_callback();
}
#ifndef __MBED__ #ifndef __MBED__
if (CY_RSLT_SUCCESS == result) if (CY_RSLT_SUCCESS == result)
@ -69,7 +74,7 @@ cy_rslt_t cybsp_init(void)
result = cybsp_retarget_init(); result = cybsp_retarget_init();
} }
} }
#endif #endif /* __MBED__ */
#if defined(CYBSP_WIFI_CAPABLE) #if defined(CYBSP_WIFI_CAPABLE)
/* Initialize SDIO interface. /* Initialize SDIO interface.
@ -81,7 +86,7 @@ cy_rslt_t cybsp_init(void)
* CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */ * CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */
result = cybsp_wifi_sdio_init(); result = cybsp_wifi_sdio_init();
} }
#endif #endif /* defined(CYBSP_WIFI_CAPABLE) */
/* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by /* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by
* user previously. Please review the Device Configurator (design.modus) and the BSP reservation list * user previously. Please review the Device Configurator (design.modus) and the BSP reservation list

View File

@ -32,10 +32,15 @@ extern "C" {
cy_rslt_t cybsp_init(void) cy_rslt_t cybsp_init(void)
{ {
cy_rslt_t result = CY_RSLT_SUCCESS; cy_rslt_t result;
result = cyhal_hwmgr_init();
init_cycfg_system(); init_cycfg_system();
result = cybsp_register_sysclk_pm_callback();
if (CY_RSLT_SUCCESS == result)
{
result = cybsp_register_sysclk_pm_callback();
}
#ifndef __MBED__ #ifndef __MBED__
if (CY_RSLT_SUCCESS == result) if (CY_RSLT_SUCCESS == result)
@ -64,7 +69,7 @@ cy_rslt_t cybsp_init(void)
result = cybsp_retarget_init(); result = cybsp_retarget_init();
} }
} }
#endif #endif /* __MBED__ */
/* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by /* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by
* user previously. Please review the Device Configurator (design.modus) and the BSP reservation list * user previously. Please review the Device Configurator (design.modus) and the BSP reservation list

View File

@ -34,10 +34,15 @@ extern "C" {
cy_rslt_t cybsp_init(void) cy_rslt_t cybsp_init(void)
{ {
cy_rslt_t result = CY_RSLT_SUCCESS; cy_rslt_t result;
result = cyhal_hwmgr_init();
init_cycfg_system(); init_cycfg_system();
result = cybsp_register_sysclk_pm_callback();
if (CY_RSLT_SUCCESS == result)
{
result = cybsp_register_sysclk_pm_callback();
}
#ifndef __MBED__ #ifndef __MBED__
if (CY_RSLT_SUCCESS == result) if (CY_RSLT_SUCCESS == result)
@ -66,7 +71,7 @@ cy_rslt_t cybsp_init(void)
result = cybsp_retarget_init(); result = cybsp_retarget_init();
} }
} }
#endif #endif /* __MBED__ */
#if defined(CYBSP_WIFI_CAPABLE) #if defined(CYBSP_WIFI_CAPABLE)
/* Initialize UDB SDIO interface. This must be done before any other HAL API attempts to allocate clocks or DMA /* Initialize UDB SDIO interface. This must be done before any other HAL API attempts to allocate clocks or DMA
@ -79,7 +84,7 @@ cy_rslt_t cybsp_init(void)
* CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */ * CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */
result = cybsp_wifi_sdio_init(); result = cybsp_wifi_sdio_init();
} }
#endif #endif /* defined(CYBSP_WIFI_CAPABLE) */
/* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by /* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by
* user previously. Please review the Device Configurator (design.modus) and the BSP reservation list * user previously. Please review the Device Configurator (design.modus) and the BSP reservation list

View File

@ -33,10 +33,15 @@ extern "C" {
cy_rslt_t cybsp_init(void) cy_rslt_t cybsp_init(void)
{ {
cy_rslt_t result = CY_RSLT_SUCCESS; cy_rslt_t result;
result = cyhal_hwmgr_init();
init_cycfg_system(); init_cycfg_system();
result = cybsp_register_sysclk_pm_callback();
if (CY_RSLT_SUCCESS == result)
{
result = cybsp_register_sysclk_pm_callback();
}
#ifndef __MBED__ #ifndef __MBED__
if (CY_RSLT_SUCCESS == result) if (CY_RSLT_SUCCESS == result)
@ -57,7 +62,7 @@ cy_rslt_t cybsp_init(void)
result = cybsp_retarget_init(); result = cybsp_retarget_init();
} }
} }
#endif #endif /* __MBED__ */
#if defined(CYBSP_WIFI_CAPABLE) #if defined(CYBSP_WIFI_CAPABLE)
/* Initialize SDIO interface. /* Initialize SDIO interface.
@ -69,7 +74,7 @@ cy_rslt_t cybsp_init(void)
* CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */ * CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */
result = cybsp_wifi_sdio_init(); result = cybsp_wifi_sdio_init();
} }
#endif #endif /* defined(CYBSP_WIFI_CAPABLE) */
/* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by /* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by
* user previously. Please review the Device Configurator (design.modus) and the BSP reservation list * user previously. Please review the Device Configurator (design.modus) and the BSP reservation list

View File

@ -33,10 +33,15 @@ extern "C" {
cy_rslt_t cybsp_init(void) cy_rslt_t cybsp_init(void)
{ {
cy_rslt_t result = CY_RSLT_SUCCESS; cy_rslt_t result;
result = cyhal_hwmgr_init();
init_cycfg_system(); init_cycfg_system();
result = cybsp_register_sysclk_pm_callback();
if (CY_RSLT_SUCCESS == result)
{
result = cybsp_register_sysclk_pm_callback();
}
#ifndef __MBED__ #ifndef __MBED__
if (CY_RSLT_SUCCESS == result) if (CY_RSLT_SUCCESS == result)
@ -62,7 +67,7 @@ cy_rslt_t cybsp_init(void)
result = cybsp_retarget_init(); result = cybsp_retarget_init();
} }
} }
#endif #endif /* __MBED__ */
#if defined(CYBSP_WIFI_CAPABLE) #if defined(CYBSP_WIFI_CAPABLE)
/* Initialize UDB SDIO interface. This must be done before any other HAL API attempts to allocate clocks or DMA /* Initialize UDB SDIO interface. This must be done before any other HAL API attempts to allocate clocks or DMA
@ -75,7 +80,7 @@ cy_rslt_t cybsp_init(void)
* CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */ * CYBSP_WIFI_SDIO_CMD, CYBSP_WIFI_SDIO_CLK and CYBSP_WIFI_WL_REG_ON */
result = cybsp_wifi_sdio_init(); result = cybsp_wifi_sdio_init();
} }
#endif #endif /* defined(CYBSP_WIFI_CAPABLE) */
/* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by /* CYHAL_HWMGR_RSLT_ERR_INUSE error code could be returned if any needed for BSP resource was reserved by
* user previously. Please review the Device Configurator (design.modus) and the BSP reservation list * user previously. Please review the Device Configurator (design.modus) and the BSP reservation list

View File

@ -135,6 +135,7 @@ void cybsp_btn_set_interrupt(cybsp_btn_t which, cyhal_gpio_event_t type, cyhal_g
/** /**
* \brief Registers a power management callback that prepares the clock system * \brief Registers a power management callback that prepares the clock system
* for entering deep sleep mode and restore the clocks upon wakeup from deep sleep. * for entering deep sleep mode and restore the clocks upon wakeup from deep sleep.
* NOTE: This is called automatically as part of \ref cybsp_init
* \returns CY_RSLT_SUCCESS if the callback is sucessfully registered, if there is * \returns CY_RSLT_SUCCESS if the callback is sucessfully registered, if there is
* a problem registering the callback it returns CYBSP_RSLT_ERR_SYSCLK_PM_CALLBACK. * a problem registering the callback it returns CYBSP_RSLT_ERR_SYSCLK_PM_CALLBACK.
*/ */

View File

@ -62,9 +62,6 @@ void mbed_sdk_init(void)
/* Placed here as it must be done after proper LIBC initialization. */ /* Placed here as it must be done after proper LIBC initialization. */
SystemInit(); SystemInit();
/* Initialize hardware resource manager */
cyhal_hwmgr_init();
#if defined(COMPONENT_SPM_MAILBOX) #if defined(COMPONENT_SPM_MAILBOX)
mailbox_init(); mailbox_init();
#endif #endif