@@ -30,9 +30,9 @@ use embedded_hal::adc::OneShot;
30
30
use embedded_hal:: digital:: v2:: { InputPin , OutputPin , StatefulOutputPin } ;
31
31
use rp2040_hal:: gpio:: bank0:: Gpio28 ;
32
32
use rp2040_hal:: gpio:: { self , Input , PullUp } ;
33
- use usbd_human_interface_device:: device:: keyboard:: BootKeyboardInterface ;
34
33
use usbd_human_interface_device:: page:: Keyboard ;
35
34
use usbd_human_interface_device:: prelude:: UsbHidClassBuilder ;
35
+ use usbd_human_interface_device:: prelude:: * ;
36
36
use usbd_human_interface_device:: UsbHidError ;
37
37
38
38
mod rgb_matrix;
@@ -274,7 +274,7 @@ fn main() -> ! {
274
274
// Set up the USB Communications Class Device driver
275
275
//let mut serial = SerialPort::new(&usb_bus);
276
276
let mut keyboard_hid = UsbHidClassBuilder :: new ( )
277
- . add_interface ( BootKeyboardInterface :: default_config ( ) )
277
+ . add_device ( usbd_human_interface_device :: device :: keyboard :: BootKeyboardConfig :: default ( ) )
278
278
. build ( & usb_bus) ;
279
279
280
280
#[ cfg( feature = "macropad" ) ]
@@ -502,19 +502,19 @@ fn main() -> ! {
502
502
}
503
503
504
504
if !usb_suspended {
505
- let _ = keyboard_hid. interface ( ) . read_report ( ) ;
505
+ let _ = keyboard_hid. device ( ) . read_report ( ) ;
506
506
507
507
// Setup the report for the control channel
508
508
let keycodes = if let Some ( keycode) = keycode {
509
509
[ keycode]
510
510
} else {
511
511
[ Keyboard :: NoEventIndicated ]
512
512
} ;
513
- match keyboard_hid. interface ( ) . write_report ( keycodes) {
513
+ match keyboard_hid. device ( ) . write_report ( keycodes) {
514
514
Err ( UsbHidError :: WouldBlock ) | Err ( UsbHidError :: Duplicate ) | Ok ( _) => { }
515
515
Err ( e) => panic ! ( "Failed to write keyboard report: {:?}" , e) ,
516
516
}
517
- match keyboard_hid. interface ( ) . tick ( ) {
517
+ match keyboard_hid. tick ( ) {
518
518
Err ( UsbHidError :: WouldBlock ) | Ok ( _) => { }
519
519
Err ( e) => panic ! ( "Failed to process keyboard tick: {:?}" , e) ,
520
520
}
0 commit comments