Skip to content

Commit e869582

Browse files
mbolivar-nordicioannisg
authored andcommitted
led.h: clarify brightness API for on/off LEDs
This clarification makes Zephyr's LED brightness API match the behavior that both the Android lights HAL and Linux's userspace LED drivers expose. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
1 parent 5cb95c4 commit e869582

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/drivers/led.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ static inline int z_impl_led_get_info(const struct device *dev, uint32_t led,
179179
* This optional routine sets the brightness of a LED to the given value.
180180
* Calling this function after led_blink() won't affect blinking.
181181
*
182+
* LEDs which can only be turned on or off may provide this function.
183+
* These should simply turn the LED on if @p value is nonzero, and off
184+
* if @p value is zero.
185+
*
182186
* @param dev LED device
183187
* @param led LED number
184188
* @param value Brightness value to set in percent

0 commit comments

Comments
 (0)