diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:13:02 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-10-22 21:13:02 -0400 |
commit | 6c956a383834b66c29591294f0926ced22f3e3b7 (patch) | |
tree | 00214f59655cf96d747228d9ffb8f6059b63b31c /wirish/HardwareTimer.cpp | |
parent | dd7e6ecdafcb8938e23dfd18a36d70628fbc74bd (diff) | |
download | librambutan-6c956a383834b66c29591294f0926ced22f3e3b7.tar.gz librambutan-6c956a383834b66c29591294f0926ced22f3e3b7.zip |
maple mini runs blinky now.
still need usb descriptors to improve, and also nothing else is tested.
Diffstat (limited to 'wirish/HardwareTimer.cpp')
-rw-r--r-- | wirish/HardwareTimer.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/wirish/HardwareTimer.cpp b/wirish/HardwareTimer.cpp index 6fbad8b..5b80ec1 100644 --- a/wirish/HardwareTimer.cpp +++ b/wirish/HardwareTimer.cpp @@ -22,10 +22,8 @@ * THE SOFTWARE. *****************************************************************************/ -/** - * @brief wirish timer class to manage the four 16-bit timer peripherals - * - * This implementation is not very efficient (lots of duplicated functions) +/* + * wirish timer class to manage the four 16-bit timer peripherals */ #include "wirish.h" @@ -69,10 +67,6 @@ uint16 HardwareTimer::getCount(void) { return timer_get_count(this->timerNum); } -/* This function will set the prescaler and overflow to get a period - * of the given length with the most resolution; the return value is - * the overflow value and thus the largest value that can be set as a - * compare. */ uint16 HardwareTimer::setPeriod(uint32 microseconds) { // XXX: 72MHz shouldn't be hard coded in here... global define? @@ -92,19 +86,19 @@ uint16 HardwareTimer::setPeriod(uint32 microseconds) { return this->overflow; } -void HardwareTimer::setChannel1Mode(uint8 mode) { +void HardwareTimer::setChannel1Mode(TimerMode mode) { timer_set_mode(this->timerNum,1,mode); } -void HardwareTimer::setChannel2Mode(uint8 mode) { +void HardwareTimer::setChannel2Mode(TimerMode mode) { timer_set_mode(this->timerNum,2,mode); } -void HardwareTimer::setChannel3Mode(uint8 mode) { +void HardwareTimer::setChannel3Mode(TimerMode mode) { timer_set_mode(this->timerNum,3,mode); } -void HardwareTimer::setChannel4Mode(uint8 mode) { +void HardwareTimer::setChannel4Mode(TimerMode mode) { timer_set_mode(this->timerNum,4,mode); } |