summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-02 15:09:36 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-02 15:09:36 +0100
commita12be917a4644305e7813b3f4b11880aba3632ca (patch)
treed1c5cacae61e38673d034bbdc55b0a534c9fc62a /stmhal/main.c
parent69dee59ce44685d34662870fff439d7249cace36 (diff)
downloadmicropython-a12be917a4644305e7813b3f4b11880aba3632ca.tar.gz
micropython-a12be917a4644305e7813b3f4b11880aba3632ca.zip
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/main.c')
-rw-r--r--stmhal/main.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index d6d9b9ed7e..afef84e290 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -22,6 +22,7 @@
#include "readline.h"
#include "pyexec.h"
#include "usart.h"
+#include "timer.h"
#include "led.h"
#include "exti.h"
#include "usrsw.h"
@@ -38,7 +39,6 @@
#include "dac.h"
#include "pin.h"
#if 0
-#include "timer.h"
#include "pybwlan.h"
#endif
@@ -177,6 +177,7 @@ int main(void) {
// basic sub-system init
pendsv_init();
+ timer_tim3_init();
led_init();
switch_init0();
@@ -409,6 +410,11 @@ soft_reset:
rng_init();
#endif
+#if MICROPY_HW_ENABLE_TIMER
+ // timer
+ //timer_init();
+#endif
+
// I2C
i2c_init();
@@ -422,13 +428,6 @@ soft_reset:
servo_init();
#endif
-#if 0
-#if MICROPY_HW_ENABLE_TIMER
- // timer
- timer_init();
-#endif
-#endif
-
#if MICROPY_HW_ENABLE_DAC
// DAC
dac_init();