From 78bf608518a2533c176c3e0314d73048decefef8 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 19 Sep 2015 16:11:15 +0200 Subject: improved linking step --- usb-fastled/usb-fastled.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'usb-fastled') diff --git a/usb-fastled/usb-fastled.cpp b/usb-fastled/usb-fastled.cpp index 06e1cfc..4e5e2cf 100644 --- a/usb-fastled/usb-fastled.cpp +++ b/usb-fastled/usb-fastled.cpp @@ -82,23 +82,14 @@ void fastled_init() } -void leds_set(CRGB color) -{ - uint8_t i; - for(i = 0; i < NUM_LEDS; ++i) { - leds[i] = color; - } - FastLED.show(); -} - void handle_cmd(uint8_t cmd) { switch(cmd) { - case '0': leds_set(CRGB::Black); led_off(); break; - case '1': leds_set(CRGB::White); led_on(); break; - case 'r': leds_set(CRGB::Red); led_on(); break; - case 'g': leds_set(CRGB::Green); led_on(); break; - case 'b': leds_set(CRGB::Blue); led_on(); break; + case '0': fill_solid(leds, NUM_LEDS, CRGB::Black); FastLED.show(); led_off(); break; + case '1': fill_solid(leds, NUM_LEDS, CRGB::White); FastLED.show(); led_on(); break; + case 'r': fill_solid(leds, NUM_LEDS, CRGB::Red); FastLED.show(); led_on(); break; + case 'g': fill_solid(leds, NUM_LEDS, CRGB::Green); FastLED.show(); led_on(); break; + case 'b': fill_solid(leds, NUM_LEDS, CRGB::Blue); FastLED.show(); led_on(); break; case '!': reset2bootloader(); break; default: printf("error\r\n"); return; } -- cgit v1.2.3