aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/rgb.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/rgb.c b/kernel/rgb.c
index a98d4b2..d16b77c 100644
--- a/kernel/rgb.c
+++ b/kernel/rgb.c
@@ -46,6 +46,8 @@ rgb(void *arg)
}
}
+#define SCALE 80 /* gives ~50Hz duty cycle */
+
void
pwm(void *arg)
{
@@ -63,13 +65,13 @@ pwm(void *arg)
/* on */
if (t) {
PORTB |= _BV(a->pin);
- sleep(0, t * 80);
+ sleep(0, t * SCALE);
}
/* off */
if ((t = UINT8_MAX - t)) {
PORTB &= ~_BV(a->pin);
- sleep(0, t * 80);
+ sleep(0, t * SCALE);
}
}
}