mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #14032 from jeromecoutant/PR_RESET_GPIO
STM32: RESET GPIO during init is configurablepull/14162/head
commit
eff0d4c8b9
|
@ -94,6 +94,7 @@ MBED_WEAK void TargetBSP_Init(void) {
|
|||
/** Do nothing */
|
||||
}
|
||||
|
||||
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
|
||||
void GPIO_Full_Init(void) {
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
|
@ -160,6 +161,7 @@ void GPIO_Full_Init(void) {
|
|||
__HAL_RCC_GPIOK_CLK_DISABLE();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// This function is called after RAM initialization and before main.
|
||||
void mbed_sdk_init()
|
||||
|
@ -311,8 +313,10 @@ void mbed_sdk_init()
|
|||
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
|
||||
#endif /* DEVICE_RTC */
|
||||
|
||||
#if MBED_CONF_TARGET_GPIO_RESET_AT_INIT
|
||||
/* Reset all GPIO */
|
||||
GPIO_Full_Init();
|
||||
#endif
|
||||
|
||||
/* BSP initialization hook (external RAM, etc) */
|
||||
TargetBSP_Init();
|
||||
|
|
|
@ -1157,6 +1157,10 @@
|
|||
"lpticker_lptim_clock": {
|
||||
"help": "Default value for LPTIM clock (lpticker_lptim == 1). Value is the dividing factor. Choose 1, 2 or 4",
|
||||
"value": 1
|
||||
},
|
||||
"gpio_reset_at_init": {
|
||||
"help": "if value set, all GPIO are reset during init",
|
||||
"value": false
|
||||
}
|
||||
},
|
||||
"overrides": {
|
||||
|
@ -3285,6 +3289,9 @@
|
|||
"macro_name": "CLOCK_SOURCE"
|
||||
}
|
||||
},
|
||||
"overrides": {
|
||||
"gpio_reset_at_init": true
|
||||
},
|
||||
"device_has_add": [
|
||||
"ANALOGOUT",
|
||||
"SERIAL_ASYNCH",
|
||||
|
|
Loading…
Reference in New Issue