diff options
author | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-25 08:39:24 +0000 |
---|---|---|
committer | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2009-12-25 08:39:24 +0000 |
commit | b6674cd738cc22e61ea34cb659750ef45ce01df4 (patch) | |
tree | bfee2ae84883c32871ee13a6e0f346f144263cf6 /src/wiring/comm | |
parent | 3bb04834ffd3f90dc9015997ea11a56d9d150099 (diff) | |
download | librambutan-b6674cd738cc22e61ea34cb659750ef45ce01df4.tar.gz librambutan-b6674cd738cc22e61ea34cb659750ef45ce01df4.zip |
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
Diffstat (limited to 'src/wiring/comm')
-rw-r--r-- | src/wiring/comm/HardwareSerial.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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); |