From 753680192ced57c1183588aa4b6383f06ccba4ec Mon Sep 17 00:00:00 2001 From: Johannes Kroll Date: Tue, 6 Mar 2012 23:07:28 +0100 Subject: wip mult stuff --- pwm.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'pwm.c') diff --git a/pwm.c b/pwm.c index cf7b854..3436e9f 100644 --- a/pwm.c +++ b/pwm.c @@ -20,6 +20,7 @@ #include #include #include +#include "shiftbrite.h" volatile uint16_t value_red = 3072; volatile uint16_t value_green = 2048; @@ -32,17 +33,15 @@ void pwm_set_rgb(uint8_t r, uint8_t g, uint8_t b) value_blue = b << 4; } -void pwm_worker_loop(void) +void pwm_tick(void) { - for (;;) { - for (uint16_t i = 0; i < 4096; i++) { - // this should take about the same time for each iteration, regardless of pulse width - PORTA= (PORTA & ~((1< i? (1< i? (1< i? (1< i? (1< i? (1< i? (1<