Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
ffa30898
Commit
ffa30898
authored
Dec 22, 2016
by
Damien George
Browse files
stmhal/usrsw: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
parent
42515004
Changes
1
Show whitespace changes
Inline
Side-by-side
stmhal/usrsw.c
View file @
ffa30898
...
...
@@ -54,13 +54,7 @@
// this function inits the switch GPIO so that it can be used
void
switch_init0
(
void
)
{
mp_hal_gpio_clock_enable
(
MICROPY_HW_USRSW_PIN
.
gpio
);
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
);
mp_hal_pin_config
(
&
MICROPY_HW_USRSW_PIN
,
MP_HAL_PIN_MODE_INPUT
,
MICROPY_HW_USRSW_PULL
,
0
);
}
int
switch_get
(
void
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment