fix RGB setting
This commit is contained in:
parent
fb2dda3fb3
commit
9fddbd4449
13
main.c
13
main.c
|
@ -159,6 +159,19 @@ void led_blue(uint16_t bightness)
|
|||
TIM2->CCR1L.reg = (bightness >> 0); // set duty cycle
|
||||
}
|
||||
|
||||
void led_rgb(uint8_t* rgb)
|
||||
{
|
||||
if (NULL == rgb) {
|
||||
return;
|
||||
}
|
||||
led_red(rgb[0] << 8);
|
||||
led_green(rgb[1] << 8);
|
||||
led_blue(rgb[2] << 8);
|
||||
// no idea why, but if I don't do it a second time the blue is a bit on when switched off
|
||||
// it is not about the register order or preload
|
||||
led_blue(rgb[2] << 8);
|
||||
}
|
||||
|
||||
// configure timer to capture IR NEC codes
|
||||
static void timer_ir_in(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue