fbd-dev-led: Allow to lookup color
This allows us to make the led structure into an opaque in the next commit
This commit is contained in:
committed by
Guido Gunther
parent
8ad1c43ff1
commit
5d8b2e5fe4
@@ -165,3 +165,10 @@ fbd_dev_led_start_periodic (FbdDevLed *led,
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
fbd_dev_led_has_color (FbdDevLed *led, FbdFeedbackLedColor color)
|
||||
{
|
||||
return (led->color == FBD_FEEDBACK_LED_COLOR_RGB || led->color == color);
|
||||
}
|
||||
|
||||
@@ -33,5 +33,6 @@ gboolean fbd_dev_led_start_periodic (FbdDevLed *led,
|
||||
FbdFeedbackLedColor color,
|
||||
guint max_brightness_percentage,
|
||||
guint freq);
|
||||
gboolean fbd_dev_led_has_color (FbdDevLed *led, FbdFeedbackLedColor color);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ find_led_by_color (FbdDevLeds *self, FbdFeedbackLedColor color)
|
||||
|
||||
for (GSList *l = self->leds; l != NULL; l = l->next) {
|
||||
FbdDevLed *led = l->data;
|
||||
if (led->color == FBD_FEEDBACK_LED_COLOR_RGB || led->color == color)
|
||||
if (fbd_dev_led_has_color (led, color))
|
||||
return led;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user