File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ pub struct Board {
3535
3636 pub buttons_shifter : adv_shift_registers:: wrappers:: ShifterValue ,
3737 pub lcd : adv_shift_registers:: wrappers:: ShifterValue ,
38+
39+ // usb pins
40+ pub usb_dp : AnyPin < ' static > ,
41+ pub usb_dm : AnyPin < ' static > ,
3842}
3943
4044impl Board {
@@ -57,6 +61,8 @@ impl Board {
5761 let mosi = peripherals. GPIO6 . degrade ( ) ;
5862 let battery = peripherals. GPIO2 ;
5963 let stackmat_rx = peripherals. GPIO20 . degrade ( ) ;
64+ let usb_dp = peripherals. GPIO19 . degrade ( ) ;
65+ let usb_dm = peripherals. GPIO18 . degrade ( ) ;
6066
6167 let button_input = Input :: new (
6268 peripherals. GPIO3 ,
@@ -111,6 +117,8 @@ impl Board {
111117 buttons_shifter,
112118 digits_shifters,
113119 lcd,
120+ usb_dp,
121+ usb_dm,
114122 } )
115123 }
116124}
Original file line number Diff line number Diff line change @@ -282,6 +282,15 @@ async fn main(spawner: Spawner) {
282282 } ;
283283
284284 utils:: backtrace_store:: read_saved_backtrace ( ) . await ;
285+ // TODO: test disable usb
286+ esp_hal:: gpio:: Input :: new (
287+ board. usb_dp ,
288+ esp_hal:: gpio:: InputConfig :: default ( ) . with_pull ( esp_hal:: gpio:: Pull :: None ) ,
289+ ) ;
290+ esp_hal:: gpio:: Input :: new (
291+ board. usb_dm ,
292+ esp_hal:: gpio:: InputConfig :: default ( ) . with_pull ( esp_hal:: gpio:: Pull :: None ) ,
293+ ) ;
285294
286295 let ws_sleep_sig = Rc :: new ( Signal :: new ( ) ) ;
287296 spawner. must_spawn ( ws:: ws_task (
You can’t perform that action at this time.
0 commit comments