diff options
-rw-r--r-- | shiftbrite.c | 17 |
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(); |