From 799100520ee8ba98980de6a6f7097ec17922ccb5 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 5 Jan 2012 11:01:50 +0000 Subject: reduce variable count --- kernel/rgb.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'kernel') 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); } } } -- cgit v1.2.3