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
ed559de0
Commit
ed559de0
authored
Dec 22, 2016
by
Damien George
Browse files
stmhal/led: Use mp_hal_pin_config function instead of HAL_GPIO_Init.
parent
ffa30898
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/led.c
View file @
ed559de0
...
...
@@ -133,13 +133,7 @@ STATIC void led_pwm_init(int led) {
const
led_pwm_config_t
*
pwm_cfg
=
&
led_pwm_config
[
led
-
1
];
// GPIO configuration
GPIO_InitTypeDef
gpio_init
;
gpio_init
.
Pin
=
led_pin
->
pin_mask
;
gpio_init
.
Mode
=
GPIO_MODE_AF_PP
;
gpio_init
.
Speed
=
GPIO_SPEED_FAST
;
gpio_init
.
Pull
=
GPIO_NOPULL
;
gpio_init
.
Alternate
=
pwm_cfg
->
alt_func
;
HAL_GPIO_Init
(
led_pin
->
gpio
,
&
gpio_init
);
mp_hal_pin_config
(
led_pin
,
MP_HAL_PIN_MODE_ALT
,
MP_HAL_PIN_PULL_NONE
,
pwm_cfg
->
alt_func
);
// TIM configuration
switch
(
pwm_cfg
->
tim_id
)
{
...
...
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