I tested the
SX1 LEDs with the uBASIC set_led command and it is rather interesting what it can do in
SX1! I did not find any documentation about set_led other than an old thing in wikia which says "ONLY for S3 (and S2 I guess)" and is not valid for
SX1, so here goes. The working syntax for
SX1 is:
set_led a b
where a is the LED number from 0 to 4 and b is the state for the LED. Note that set_led accepts a third argument (for compatibility's sake, I guess, it is brightness in some older cams) that is ignored in
SX1. The LED numbers in
SX1 are:
0: power button green
1: power button orange
2: card/busy (red)
3: print/shortcut (blue)
4: AF/red-eye/timer (bright green)
The state is the interesting part, as I found that it can be 0 to 6:
0: off
1: on
2: blinking 2 Hz (on shorter than off)
3: blinking really fast (about 5 Hz)
4: blinking about 2,8 Hz (on longer than off)
5: 3 fast blinks then off
6: blinking 1 Hz (about equal on/off times)
As a curiosity, combining different blinkings for the two power-button LEDs make for interesting more complex multi-color blinkings 😀
EDIT: Oh, about the implementation, those are all done by calling an original firmware function and the firmware then has a LED driver that implements the blinkings. The uBASIC command just maps the LED numbers a bit differently (a bit strange: those 0,1,2,3,4 become 4,5,7,8,9) and then calls _LEDDrive that is in firmware.
EDIT2: Argh, edited for AF LED, I had previously enabled the debug_led, which caused the AF LED seem not to respond to set_led.