mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user