1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9<title>KBDSetLedsRetry</title>
10</head>
11
12<body>
13
14<h1>KBDSetLedsRetry</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/kbd.h&gt;
19
20KBDEc KBDSetLedsRetry (KBDChannel ch, KBDLedState leds);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>ch</TH>
27<TD>Keyboard channel to set.</TD>
28  </tr>
29  <tr>
30<TH>leds</TH>
31<TD>New <code>KBDLedState</code> to send to the keyboard.</TD>
32  </tr>
33</TABLE>
34
35<h2>Return Values</h2>
36<TABLE class="arguments" border="1" >
37  <tr>
38<TH>KBDEc</TH>
39<TD>Keyboard error code.<br><code>KBD_SUCCESS</code> if the call was successful.<br><code>KBD_ERR_NOT_INITIALIZED</code> if the library was not initialized.<br><code>KBD_ERR_BAD_VALUE</code> if <SPAN class="argument">ch</SPAN> or <SPAN class="argument">leds</SPAN> is out of range.<br>
40    </TD>
41  </tr>
42</TABLE>
43
44<h2>Description</h2>
45<p>Sends an LED command to the keyboard on channel <SPAN class="argument">ch</SPAN>. The command tells the keyboard to turn on the LEDs specified by <SPAN class="argument">leds</SPAN>. If the attempt fails due to the <code>KBD_ERR_BUSY</code> 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.</p>
46<p><code>KBDSetLedsRetry</code> 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, <a href="KBDSetLeds.html"><code>KBDSetLeds</code></a>.</p>
47<p>Because <code>KBDSetLedsRetry</code> 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.</p>
48<p>This function will always attempt to send the LED command. Any &quot;lazy&quot; setting of LED state must be done at a higher level.</p>
49
50<h2>See Also</h2>
51<P class="reference">
52<a href="list.html">Keyboard Functions</a>,
53<a href="KBDSetLeds.html">KBDSetLeds</a>,
54<a href="KBDSetLedsAsync.html">KBDSetLedsAsync</a>
55</p>
56
57<h2>Revision History</h2>
58<P>
592007/03/19 Initial version.<br>
60</p>
61
62<hr><p>CONFIDENTIAL</p></body>
63</HTML>
64