File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ bool HID_::setup(USBSetup& setup)
145
145
if (2 == USB_RecvControl (data, length))
146
146
{
147
147
_keyboardLedsStatus = data[1 ];
148
+ if (keyboardLedsStatusReportCallback != 0 )
149
+ {
150
+ keyboardLedsStatusReportCallback ();
151
+ }
148
152
return true ;
149
153
}
150
154
}
@@ -159,12 +163,18 @@ uint8_t HID_::getKeyboardLedsStatus(void)
159
163
return _keyboardLedsStatus;
160
164
}
161
165
166
+ void HID_::setKeyboardLedsStatusReportCallback (void (*callback) (void ) )
167
+ {
168
+ keyboardLedsStatusReportCallback = callback;
169
+ }
170
+
162
171
HID_::HID_ (void ) : PluggableUSBModule(1 , 1 , epType),
163
172
rootNode(NULL ), descriptorSize(0 ),
164
173
protocol(HID_REPORT_PROTOCOL), idle(1 )
165
174
{
166
175
epType[0 ] = EP_TYPE_INTERRUPT_IN;
167
176
PluggableUSB ().plug (this );
177
+ setKeyboardLedsStatusReportCallback ( 0 );
168
178
}
169
179
170
180
int HID_::begin (void )
You can’t perform that action at this time.
0 commit comments