diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-02 15:09:36 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-02 15:09:36 +0100 |
| commit | a12be917a4644305e7813b3f4b11880aba3632ca (patch) | |
| tree | d1c5cacae61e38673d034bbdc55b0a534c9fc62a /stmhal/led.c | |
| parent | 69dee59ce44685d34662870fff439d7249cace36 (diff) | |
stmhal: Add timer module; move servo PWM from TIM2 to TIM5.
As per issue #257, servo is better on TIM5 because TIM2 is connected to
more GPIO.
Diffstat (limited to 'stmhal/led.c')
| -rw-r--r-- | stmhal/led.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stmhal/led.c b/stmhal/led.c index b7afdd40c..3108ee779 100644 --- a/stmhal/led.c +++ b/stmhal/led.c @@ -1,7 +1,5 @@ #include <stdio.h> #include <stm32f4xx_hal.h> -#include "usbd_cdc_msc_hid.h" -#include "usbd_cdc_interface.h" #include "nlr.h" #include "misc.h" @@ -9,6 +7,7 @@ #include "qstr.h" #include "obj.h" #include "runtime.h" +#include "timer.h" #include "led.h" #include "pin.h" #include "build/pins.h" @@ -54,6 +53,8 @@ void led_init(void) { // LED4 (blue) is on PB4 which is TIM3_CH1 // we use PWM on this channel to fade the LED + // LED3 (yellow) is on PA15 which has TIM2_CH1, so we could PWM that as well + // GPIO configuration GPIO_InitStructure.Pin = MICROPY_HW_LED4.pin_mask; GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; |
