STM32: add weak TargetBSP_Init function

pull/13022/head
jeromecoutant 2020-05-27 09:21:26 +02:00
parent c7759fe505
commit 76135d0820
2 changed files with 19 additions and 17 deletions

View File

@ -139,20 +139,6 @@ const uint8_t D1CorePrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7,
* @{
*/
/**
* @brief Setup the target board-specific configuration
* of the microcontroller
*
* @note If used, this function should be implemented
* elsewhere. This declaration is weak so it may be overridden
* by user code.
*
* @param None
* @retval None
*/
__weak void TargetBSP_Init(void) {
/** Do nothing */
}
/**
* @brief Setup the microcontroller system
@ -232,9 +218,6 @@ void SystemInit(void)
#endif /* CORE_CM7*/
/* BSP initialization hook (external RAM, etc) */
TargetBSP_Init();
#ifdef CORE_CM4
/* Configure the Vector Table location add offset address ------------------*/

View File

@ -31,6 +31,22 @@
int mbed_sdk_inited = 0;
extern void SetSysClock(void);
/**
* @brief Setup the target board-specific configuration
* of the microcontroller
*
* @note If used, this function should be implemented
* elsewhere. This declaration is weak so it may be overridden
* by user code.
*
* @param None
* @retval None
*/
MBED_WEAK void TargetBSP_Init(void) {
/** Do nothing */
}
// This function is called after RAM initialization and before main.
void mbed_sdk_init()
{
@ -150,5 +166,8 @@ void mbed_sdk_init()
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
#endif /* DEVICE_RTC */
/* BSP initialization hook (external RAM, etc) */
TargetBSP_Init();
mbed_sdk_inited = 1;
}