drivers/leds/rgbled.c: Fix a compilation error introduced with a recent change to add multi-channel operation to RGB LED driver.

This commit is contained in:
Gregory Nutt
2018-05-05 12:26:45 -06:00
parent b5a4d6d9ef
commit ec7c4020f9
+9 -7
View File
@@ -305,7 +305,9 @@ static ssize_t rgbled_write(FAR struct file *filep, FAR const char *buffer,
unsigned int green; unsigned int green;
unsigned int blue; unsigned int blue;
char color[3]; char color[3];
#ifdef CONFIG_PWM_MULTICHAN
int i; int i;
#endif
/* We need to receive a string #RRGGBB = 7 bytes */ /* We need to receive a string #RRGGBB = 7 bytes */
@@ -460,16 +462,16 @@ static ssize_t rgbled_write(FAR struct file *filep, FAR const char *buffer,
ledb->ops->start(ledb, &pwm); ledb->ops->start(ledb, &pwm);
} }
#else #else
pwminfo.frequency = 100; pwm.frequency = 100;
pwminfo.duty = red; pwm.duty = red;
ledr->ops->start(ledr, &pwminfo); ledr->ops->start(ledr, &pwm);
pwminfo.duty = green; pwm.duty = green;
ledg->ops->start(ledg, &pwminfo); ledg->ops->start(ledg, &pwm);
pwminfo.duty = blue; pwm.duty = blue;
ledb->ops->start(ledb, &pwminfo); ledb->ops->start(ledb, &pwm);
#endif #endif
return buflen; return buflen;