summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Kroll <jkroll@lavabit.com>2012-03-06 23:19:49 +0100
committerJohannes Kroll <jkroll@lavabit.com>2012-03-06 23:19:49 +0100
commitb9d468299fc3699c6ae4c10b4b9a683dadb778e7 (patch)
tree0321b7f10f0825557ce470b8e3c3bb0d235f6efb
parent753680192ced57c1183588aa4b6383f06ccba4ec (diff)
mult stuff fixed
-rw-r--r--shiftbrite.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/shiftbrite.c b/shiftbrite.c
index a5f319b..048405f 100644
--- a/shiftbrite.c
+++ b/shiftbrite.c
@@ -94,21 +94,10 @@ void sb_setcolor(uint8_t lamp_index, uint8_t r, uint8_t g, uint8_t b)
if(lamp_index >= MAXSHIFTBRITES) return;
if(lamp_index+1 > sb_num_shiftbrites) sb_num_shiftbrites= lamp_index+1;
- sb_colors[lamp_index].r= r*r>>6;
- sb_colors[lamp_index].g= g*g>>6;
- sb_colors[lamp_index].b= b*b>>6;
+ sb_colors[lamp_index].r= (uint16_t)r*r>>6;
+ sb_colors[lamp_index].g= (uint16_t)g*g>>6;
+ sb_colors[lamp_index].b= (uint16_t)b*b>>6;
-
- char ch[256];
- sprintf(ch, "%" PRIx16 " %" PRIx16 " %" PRIx16 "\n", sb_colors[lamp_index].r, sb_colors[lamp_index].g, sb_colors[lamp_index].b);
- serial_send(ch, strlen(ch), 1);
-
- /* works */
-/*
- sb_colors[lamp_index].r= ((uint16_t)r*r>>6);
- sb_colors[lamp_index].g= ((uint16_t)g*g>>6);
- sb_colors[lamp_index].b= ((uint16_t)b*b>>6);
-*/
/*
updates are now done in sb_tick()
sb_update_all_colors();