aboutsummaryrefslogtreecommitdiff
path: root/wirish/comm/HardwareSerial.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-03-22 16:59:29 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-03-24 07:25:14 -0400
commit296b1188bfb8cf28466b95f1dd0fde309b1f9399 (patch)
treeb0ed2b9fecb2da85266e6b2b88c6fe31bb0ca2c8 /wirish/comm/HardwareSerial.h
parent68b57d90007a234e6a2fc82f6b9402fb6b77ef34 (diff)
Initial timer refactor.
Basic PWM works. Had some problems in testing that might be due to USART bugs. HardwareTimer has been removed from the build for now; I will re-implement it in terms of the new libmaple API, but consider it deprecated. Let's come up with something better. Servo is implemented in terms of HardwareTimer, so it also has been temporarily removed from the build. pwmWrite() likely got a little bit less inefficient due to indirection, but the PIN_MAPs shrank by a pointer per PinMapping.
Diffstat (limited to 'wirish/comm/HardwareSerial.h')
-rw-r--r--wirish/comm/HardwareSerial.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/wirish/comm/HardwareSerial.h b/wirish/comm/HardwareSerial.h
index ef19a56..7852d51 100644
--- a/wirish/comm/HardwareSerial.h
+++ b/wirish/comm/HardwareSerial.h
@@ -31,7 +31,9 @@
#ifndef _HARDWARESERIAL_H_
#define _HARDWARESERIAL_H_
-#include "timers.h"
+#include "libmaple_types.h"
+#include "gpio.h"
+#include "timer.h"
#include "Print.h"
@@ -49,16 +51,16 @@ class HardwareSerial : public Print {
gpio_dev *gpio_device;
uint8 tx_pin;
uint8 rx_pin;
- timer_dev_num timer_num;
- uint8 compare_num;
+ timer_dev *timer_device;
+ uint8 channel_num;
public:
HardwareSerial(uint8 usart_num,
uint32 max_baud,
gpio_dev *gpio_device,
uint8 tx_pin,
uint8 rx_pin,
- timer_dev_num timer_num,
- uint8 compare_num);
+ timer_dev *timer_device,
+ uint8 channel_num);
void begin(uint32 baud);
void end(void);
uint32 available(void);