From: Jan "Yenya" Kasprzak Date: Tue, 24 Dec 2013 23:41:53 +0000 (+0100) Subject: rgb-led-string: Christmas tree mod after real-world testing X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=85a869857e315a5f4b4b20dee7d44429c1d0cc1c;p=tinyboard.git rgb-led-string: Christmas tree mod after real-world testing --- diff --git a/projects/rgb-led-string/main.c b/projects/rgb-led-string/main.c index bd92361..a620b98 100644 --- a/projects/rgb-led-string/main.c +++ b/projects/rgb-led-string/main.c @@ -6,7 +6,7 @@ static unsigned char jiffies; -// #define CHRISTMAS_TREE 1 +#define CHRISTMAS_TREE 1 #define rgb_return(r, g, b) do { send_rgb((r), (g), (b)); return 1; } while(0) @@ -232,14 +232,16 @@ static unsigned char midstar_pixel(unsigned char pos) static void background(unsigned char pos) { #ifdef CHRISTMAS_TREE - switch ((pos >> 4) & 3) { - case 0: if (pos & 1) send_rgb(7, 0, 0); else send_rgb(0, 7, 0); + switch ((pos >> 3) & 3) { + //case 0: if (pos & 1) send_rgb(7, 0, 7); else send_rgb(0, 7, 5); + //case 0: if (pos & 1) send_rgb(0, 0, 7); else send_rgb(7, 7, 7); + case 0: if (pos & 1) send_rgb(0, 0, 7); else send_rgb(0, 7, 0); break; - case 1: if (pos & 1) send_rgb(0, 0, 7); else send_rgb(7, 7, 7); + case 1: if (pos & 1) send_rgb(7, 0, 7); else send_rgb(7, 0, 0); break; - case 2: if (pos & 1) send_rgb(7, 0, 7); else send_rgb(0, 7, 5); + case 2: if (pos & 1) send_rgb(7, 5, 0); else send_rgb(7, 7, 7); break; - case 3: if (pos & 1) send_rgb(7, 5, 0); else send_rgb(7, 7, 7); + case 3: if (pos & 1) send_rgb(7, 0, 0); else send_rgb(0, 7, 0); break; } #else