Finally fix LED-Strip driver

.. and adapt led-strip.c to changed polarity (again).
This commit is contained in:
Ralf Schlatterbeck 2015-01-26 20:44:30 +01:00
parent 301d8d77bb
commit c8be130f2e
2 changed files with 4 additions and 4 deletions

View file

@ -63,7 +63,7 @@ extern resource_t res_radio;
#include "LED_Strip_Suli.h"
int color_rgb [3] = {255, 0, 255};
uint8_t color_rgb [3] = {0, 255, 0};
static uint8_t name_to_offset (const char * name)
{
@ -83,12 +83,12 @@ color_to_string (const char *name, uint8_t is_json, char *buf, size_t bsize)
if (is_json) {
fmt = "\"%d\"";
}
return snprintf (buf, bsize, fmt, 255 - color_rgb [name_to_offset (name)]);
return snprintf (buf, bsize, fmt, color_rgb [name_to_offset (name)]);
}
void color_from_string (const char *name, const char *s)
{
color_rgb [name_to_offset (name)] = 255 - atoi (s);
color_rgb [name_to_offset (name)] = atoi (s);
led_strip_begin ();
led_strip_set_color (color_rgb [0], color_rgb [1], color_rgb [2]);
led_strip_end ();

@ -1 +1 @@
Subproject commit 5ec5d806331bf071c7f38e30344b82e9facfb88d
Subproject commit 56b7ce6c3227aeac131b59e39829c4991e7caefd