nerves-project / nerves_leds

Functions to drive LEDs on embedded systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keep alive can be implemented via the class driver

opened this issue · comments

This is more of a suggestion than an issue. It's possible to push the keep alive functionality down to the Linux kernel by putting the LED in oneshot mode. See the documentation here:

http://lxr.free-electrons.com/source/Documentation/leds/ledtrig-oneshot.txt?v=3.8

Once in oneshot mode (with the delays sent appropriately), the keep alive operation is just writing something to the /sys/class/leds/.../shot file. The kernel will automatically turn the LED off a short time later if the application stops writing to the shot file.

Excellent point. I should have done it that way. I'll redo it when I get some time. It also lets me remove initialize() and the ETS table.

Agreed. Removed in 0.7.0. Thanks, @fhunleth