summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/command.c b/command.c
index 91489e6..0212ce9 100644
--- a/command.c
+++ b/command.c
@@ -23,6 +23,7 @@
#include "pwm.h"
#include "serial.h"
#include "util.h"
+#include "shiftbrite.h"
static void command_error(void)
{
@@ -49,9 +50,18 @@ static void handle_immediate(char *buffer, uint16_t len)
command_error();
return;
}
-
- pwm_set_rgb(new_red, new_green, new_blue);
- command_success();
+
+ uint8_t sb_no;
+ if ((len > sizeof("irrggbb\r") - 1)
+ && parse_hex_number(&buffer[7], &sb_no)==0
+ && sb_no) {
+ sb_setcolor(sb_no-1, new_red, new_green, new_blue);
+ command_success();
+ }
+ else {
+ pwm_set_rgb(new_red, new_green, new_blue);
+ command_success();
+ }
}
uint16_t serial_rx_cb(char *buffer, uint16_t len)