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

View File

@ -305,7 +305,9 @@ static ssize_t rgbled_write(FAR struct file *filep, FAR const char *buffer,
unsigned int green;
unsigned int blue;
char color[3];
#ifdef CONFIG_PWM_MULTICHAN
int i;
#endif
/* 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);
}
#else
pwminfo.frequency = 100;
pwm.frequency = 100;
pwminfo.duty = red;
ledr->ops->start(ledr, &pwminfo);
pwm.duty = red;
ledr->ops->start(ledr, &pwm);
pwminfo.duty = green;
ledg->ops->start(ledg, &pwminfo);
pwm.duty = green;
ledg->ops->start(ledg, &pwm);
pwminfo.duty = blue;
ledb->ops->start(ledb, &pwminfo);
pwm.duty = blue;
ledb->ops->start(ledb, &pwm);
#endif
return buflen;