From 285732c1a08ac690f3fffcbea5a61278286f270d Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Wed, 12 Mar 2014 21:12:16 +0100 Subject: [PATCH] there *is* light at the end of the tunnel --- ledcontroller.c | 20 ++++++++++++++++++++ ledcontroller.h | 3 ++- rgbyteclock.c | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ledcontroller.c b/ledcontroller.c index 98d98fb..c606da5 100644 --- a/ledcontroller.c +++ b/ledcontroller.c @@ -87,6 +87,26 @@ static void write_global_latch(uint16_t data) } +void ledcontroller_turn_all_on(void) +{ + + write_data(0xffff, 2); + write_data(0xffff, 2); + write_data(0xffff, 2); + +} + + +void ledcontroller_turn_all_off(void) +{ + + write_data(0xffff, 2); + write_data(0xffff, 2); + write_data(0xffff, 2); + +} + + void ledcontroller_init(void) { diff --git a/ledcontroller.h b/ledcontroller.h index e7f6eb1..af5a5d3 100644 --- a/ledcontroller.h +++ b/ledcontroller.h @@ -21,7 +21,8 @@ void ledcontroller_init(void); void led_set(uint8_t lednum, uint16_t red, uint16_t green, uint16_t blue); void led_flush(void); - +void ledcontroller_turn_all_on(void); +void ledcontroller_turn_all_off(void); #endif // LEDCONTROLLER_H diff --git a/rgbyteclock.c b/rgbyteclock.c index efe43fd..2460184 100644 --- a/rgbyteclock.c +++ b/rgbyteclock.c @@ -20,6 +20,8 @@ void rgbyteclock(void) { + ledcontroller_turn_all_on(); + while(1) { PORTC ^= (1<