MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_led_set_brightness

Function rt_led_set_brightness

components/drivers/led/led.c:328–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328rt_err_t rt_led_set_brightness(struct rt_led_device *led, rt_uint32_t brightness)
329{
330 rt_err_t err;
331
332 if (!led)
333 {
334 return -RT_EINVAL;
335 }
336
337 if (!led->ops->set_brightness)
338 {
339 return -RT_ENOSYS;
340 }
341
342 rt_spin_lock(&led->spinlock);
343
344 err = led->ops->set_brightness(led, brightness);
345
346 rt_spin_unlock(&led->spinlock);
347
348 return err;
349}

Callers 1

_led_writeFunction · 0.85

Calls 2

rt_spin_lockFunction · 0.50
rt_spin_unlockFunction · 0.50

Tested by

no test coverage detected