led_blink_set_oneshot(9)
β¨ led_blink_set_oneshot β do a oneshot software blink β¨
Okay bestie, so this one is a kernel API manual page, led_blink_set_oneshot(9), and it's genuinely the cutest little function β it makes an LED do exactly one blink and then chill. Let's get into it π
πΈ SYNOPSIS πΈ
void led_blink_set_oneshot (struct led_classdev *led_cdev , unsigned
long *delay_on , unsigned long *delay_off , int invert );
Yup, that's the whole signature β no return value, it just does the thing. Periodt.
π ARGUMENTS π
led_cdevβ the LED you wanna start blinking. Your main character, fr.delay_onβ the time it should be on, in ms. Like how long the glow-up lasts β¨delay_offβ the time it should ble off, in ms. (Yes, the original says "ble" β we're keeping that typo, it's iconic and we don't gatekeep. π) Basically how long the lil' guy naps.invertβ blink off, then on, leaving the led on. The chaotic order. Love that for you.
π¦ DESCRIPTION π¦
So here's the tea: this function makes the LED blink one time for delay_on + delay_off time. One blink, that's it, no encore. π€
And listen β if another one-shot blink is already in progress, this request just gets ignored. Not me showing up late to the party π. It literally ignores it. No queuing, no nothing.
If invert is set, the led blinks for delay_off first, then for delay_on, and it leaves the led on after the on-off cycle. So the order gets flipped and you end up glowing at the end. Slay π
And the best part? This function is guaranteed not to sleep. No cap. It does not sleep. Ever. So you can call it from places where sleeping is not allowed β that's the whole vibe check it passes π₯
π SEE ALSO π
Go read these, bestie, they're all in the Kernel file ./include/linux/leds.h:
struct led_lookup_data(9)led_classdev_register_ext(9)led_classdev_register(9)led_blink_set(9)led_blink_set_nosleep(9)led_set_brightness(9)led_set_brightness_sync(9)led_mc_set_brightness(9)led_update_brightness(9)led_get_default_pattern(9)led_sysfs_disable(9)led_sysfs_enable(9)led_compose_name(9)led_get_color_name(9)led_sysfs_is_disabled(9)struct led_pattern(9)
Okay that's the whole page, mwah π«Ά. It lives in ./include/linux, and this lil' slice of kernel lore dropped in October 2026. Bye bestie, go blink something once ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms