From b6674cd738cc22e61ea34cb659750ef45ce01df4 Mon Sep 17 00:00:00 2001 From: iperry Date: Fri, 25 Dec 2009 08:39:24 +0000 Subject: Fixed delayMicroseconds, changed serial interface, added an (untested) runtime check for pwm/serial collision, moved more headers around. git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@79 749a229e-a60e-11de-b98f-4500b42dc123 --- src/wiring/comm/HardwareSerial.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wiring/comm') diff --git a/src/wiring/comm/HardwareSerial.cpp b/src/wiring/comm/HardwareSerial.cpp index 84eb4c7..3d0a0ce 100644 --- a/src/wiring/comm/HardwareSerial.cpp +++ b/src/wiring/comm/HardwareSerial.cpp @@ -27,6 +27,7 @@ #include "HardwareSerial.h" #include "usart.h" #include "gpio.h" +#include "timers.h" #define USART1_TX_PORT GPIOA_BASE #define USART1_TX_PIN 9 @@ -75,6 +76,8 @@ void HardwareSerial::begin(uint32_t baud) { case 2: gpio_set_mode(USART2_TX_PORT, USART2_TX_PIN, GPIO_MODE_AF_OUTPUT_PP); gpio_set_mode(USART2_RX_PORT, USART2_RX_PIN, GPIO_MODE_INPUT_FLOATING); + /* Turn off any pwm */ + timers_disable_channel(2, 3); break; case 3: gpio_set_mode(USART3_TX_PORT, USART3_TX_PIN, GPIO_MODE_AF_OUTPUT_PP); -- cgit v1.2.3