This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| projects:diskblinker [2026/02/06 22:42] – created azzy | projects:diskblinker [2026/05/11 16:22] (current) – edml | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # disk blinker - use caps lock LED as disk activity indicator | ||
| + | |||
| + | C program, linux. | ||
| + | Focus on making it work for me first, then figure out how to make it portable and efficient | ||
| + | Not a big project, something interesting though to start with | ||
| + | |||
| + | https:// | ||
| + | - Based on a much simpler (albeit in C++) program: https:// | ||
| + | |||
| + | # Unbuffered writes to /sys | ||
| + | Need to make fp an unbuffered stream with `setvbuf (fp, NULL, _IONBF, 0);`. This flushes writes to the leds as soon as they are written. | ||
| + | |||
| + | |||
| + | # Without polling | ||
| + | I only need: daemon that watches when disk activity file is changed (read or written) and sets LED to 1 for a few ms, then off. | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Looks like there' | ||
| + | Also I'm not sure if files from /sys can be watched with inotify API. | ||