Commit ffa30898 authored by Damien George's avatar Damien George
Browse files

stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init.

parent 42515004
...@@ -54,13 +54,7 @@ ...@@ -54,13 +54,7 @@
// this function inits the switch GPIO so that it can be used // this function inits the switch GPIO so that it can be used
void switch_init0(void) { void switch_init0(void) {
mp_hal_gpio_clock_enable(MICROPY_HW_USRSW_PIN.gpio); mp_hal_pin_config(&MICROPY_HW_USRSW_PIN, MP_HAL_PIN_MODE_INPUT, MICROPY_HW_USRSW_PULL, 0);
GPIO_InitTypeDef init;
init.Pin = MICROPY_HW_USRSW_PIN.pin_mask;
init.Mode = GPIO_MODE_INPUT;
init.Pull = MICROPY_HW_USRSW_PULL;
init.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(MICROPY_HW_USRSW_PIN.gpio, &init);
} }
int switch_get(void) { int switch_get(void) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment