aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2012-01-05 11:01:50 +0000
committerDimitri Sokolyuk <demon@dim13.org>2012-01-05 11:01:50 +0000
commit799100520ee8ba98980de6a6f7097ec17922ccb5 (patch)
treece8857cd0545e09fbfbae5ef76774700543c6d9c
parent97bf1e88bfde9107f9aec66603ce48b0bdee4351 (diff)
reduce variable count
-rw-r--r--kernel/rgb.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/rgb.c b/kernel/rgb.c
index 7532c10..0f9b482 100644
--- a/kernel/rgb.c
+++ b/kernel/rgb.c
@@ -50,7 +50,7 @@ void
pwm(void *arg)
{
struct pwmarg *a = (struct pwmarg *)arg;
- uint32_t on, off;
+ uint32_t t;
uint8_t v;
DDRB |= _BV(a->pin);
@@ -63,14 +63,16 @@ pwm(void *arg)
v = *a->value;
sei();
- if ((on = SEC2(v) / DIV)) {
+ /* on */
+ if ((t = SEC2(v) / DIV)) {
PORTB |= _BV(a->pin);
- sleep(on);
+ sleep(t);
}
- if ((off = SEC2(UINT8_MAX - v) / DIV)) {
+ /* off */
+ if ((t = SEC2(UINT8_MAX - v) / DIV)) {
PORTB &= ~_BV(a->pin);
- sleep(off);
+ sleep(t);
}
}
}