aboutsummaryrefslogtreecommitdiff
path: root/pwm.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2014-09-23 17:24:57 +0200
committerLars-Dominik Braun <lars@6xq.net>2014-09-30 15:15:01 +0200
commit6708da2661d693f855b6f56d69af1e2fb8502463 (patch)
tree5b8eac0f6f40932417519cbdcd229caeabd8eee8 /pwm.c
parent69cb10f51321a2443a3314c40fb2b8556aa804c0 (diff)
downloadhourglass-6708da2661d693f855b6f56d69af1e2fb8502463.tar.gz
hourglass-6708da2661d693f855b6f56d69af1e2fb8502463.tar.bz2
hourglass-6708da2661d693f855b6f56d69af1e2fb8502463.zip
Add wakeup source mechanism
Should reduce amount of cpu wakeups with expensive computations.
Diffstat (limited to 'pwm.c')
-rw-r--r--pwm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pwm.c b/pwm.c
index 568ed73..944720e 100644
--- a/pwm.c
+++ b/pwm.c
@@ -19,7 +19,6 @@ static const uint8_t offbits[2] = {(uint8_t) ~((1 << PB6) | (1 << PB7)),
(uint8_t) ~((1 << PD2) | (1 << PD3) | (1 << PD4) | (1 << PD5) | (1 << PD6))};
ISR(TIMER0_COMPA_vect) {
-#warning "speaker works now, led1 and 2 do not work"
if (speakerCount > 0) {
--speakerCount;
/* stop speaker after beep */
@@ -36,6 +35,8 @@ ISR(TIMER0_COMPA_vect) {
/* auto wrap-around */
count = (count+1) & (PWM_MAX_BRIGHTNESS-1);
+
+ /* no wakeup */
}
static uint8_t ledToArray (const uint8_t i) {
@@ -105,7 +106,7 @@ void pwmSet (const uint8_t i, const uint8_t value) {
}
}
-void speakerStart (const speakerMode mode) {
+void speakerStart (const speakerMode mode __unused__) {
/* 12.8ms */
speakerCount = 100;
for (uint8_t i = 0; i < PWM_MAX_BRIGHTNESS; i += 2) {