#include <cafe/kbd.h> KBDEc KBDSetLedsEx (KBDChannel ch, KBDLedState leds);
|ch||Keyboard channel to set.|
|KBDEc||Keyboard error code.
Sends an LED command to the keyboard on channel ch. The command instructs the keyboard to turn on the LEDs specified by leds.
KBDSetLedsEx is a blocking call, and it cannot be used from within a callback or whenever interrupts are disabled. To set the LEDs when interrupts are disabled, use
Because this function sends a message over the USB bus, avoid calling it too frequently; this will prevent flooding of the USB bus. Avoid sending more than 12 LED commands (total for all keyboards) per 1/60 second. Even this amount is excessive and should be avoided.
This function call may fail due to other traffic on the USB bus. If it returns
KBD_ERR_BUSY, the LED command was not sent. In this case, it is necessary to call it again.
Because the want is for the traffic to die down before trying again, have a delay between attempts.
This function will always attempt to send the LED command. Any "lazy" setting of the LED state must be performed at a higher level.
KBDSetLedsEx will block if the keyboard's ACK fails on the USB bus.
|Background||Do not call this function from the background.|
2013/06/20 Initial version 0.1.