aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/HardwareTimer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'wirish/HardwareTimer.cpp')
-rw-r--r--wirish/HardwareTimer.cpp18
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);
}