#include <revolution/kbd.h> KBDEc KBDSetLedsRetry (KBDChannel ch, KBDLedState leds);
| ch | Keyboard channel to set. |
|---|---|
| leds | New KBDLedState to send to the keyboard. |
| KBDEc | Keyboard error code.KBD_SUCCESS if the call was successful.KBD_ERR_NOT_INITIALIZED if the library was not initialized.KBD_ERR_BAD_VALUE if ch or leds is out of range. |
|---|
Sends an LED command to the keyboard on channel ch. The command tells the keyboard to turn on the LEDs specified by leds. If the attempt fails due to the KBD_ERR_BUSY condition, a timer is set to retry the call 1 millisecond later. This will continue until a retry succeeds, or until another error status occurs.
KBDSetLedsRetry is a non-blocking call, and it may be used from within a callback or whenever interrupts are disabled. This is in contrast to the blocking version of this function, KBDSetLeds.
Because KBDSetLedsRetry sends a message over the USB bus, you should refrain from calling this API too frequently to prevent flooding of the USB bus. Avoid sending more than 12 LED commands (total for all keyboards) per 1/60th of a second. Even this amount is excessive and should be avoided.
This function will always attempt to send the LED command. Any "lazy" setting of LED state must be done at a higher level.
Keyboard Functions, KBDSetLeds, KBDSetLedsAsync
2007/03/19 Initial version.
CONFIDENTIAL