@@ -64,7 +64,7 @@ use rp2040_panic_usb_boot as _;
64
64
//
65
65
// matrix.set_scaling(100).expect("failed to set scaling");
66
66
// let grid = display_panic();
67
- // fill_grid (grid, &mut matrix);
67
+ // fill_grid_pixels (grid, &mut matrix);
68
68
//
69
69
// loop {}
70
70
//}
@@ -90,7 +90,7 @@ use fugit::RateExtU32;
90
90
use usb_device:: { class_prelude:: * , prelude:: * } ;
91
91
92
92
// USB Communications Class Device support
93
- use usbd_serial:: SerialPort ;
93
+ use usbd_serial:: { SerialPort , USB_CLASS_CDC } ;
94
94
95
95
// Used to demonstrate writing formatted strings
96
96
use core:: fmt:: Write ;
@@ -202,7 +202,7 @@ fn main() -> ! {
202
202
. manufacturer ( "Framework" )
203
203
. product ( "Lotus LED Matrix" )
204
204
. serial_number ( serialnum)
205
- . device_class ( 2 ) // Communications and CDC Control. From: https://www.usb.org/defined-class-codes
205
+ . device_class ( USB_CLASS_CDC )
206
206
. build ( ) ;
207
207
208
208
// Enable LED controller
@@ -241,7 +241,7 @@ fn main() -> ! {
241
241
242
242
let mut said_hello = false ;
243
243
244
- fill_grid ( & state. grid , & mut matrix) ;
244
+ fill_grid_pixels ( & state. grid , & mut matrix) ;
245
245
246
246
let timer = Timer :: new ( pac. TIMER , & mut pac. RESETS ) ;
247
247
let mut prev_timer = timer. get_counter ( ) . ticks ( ) ;
@@ -254,7 +254,7 @@ fn main() -> ! {
254
254
255
255
// Handle period display updates. Don't do it too often
256
256
if timer. get_counter ( ) . ticks ( ) > prev_timer + 20_000 {
257
- fill_grid ( & state. grid , & mut matrix) ;
257
+ fill_grid_pixels ( & state. grid , & mut matrix) ;
258
258
if state. animate {
259
259
for x in 0 ..WIDTH {
260
260
state. grid . 0 [ x] . rotate_right ( 1 ) ;
@@ -297,7 +297,7 @@ fn main() -> ! {
297
297
handle_sleep ( go_sleeping, & mut state, & mut matrix, & mut delay) ;
298
298
}
299
299
300
- fill_grid ( & state. grid , & mut matrix) ;
300
+ fill_grid_pixels ( & state. grid , & mut matrix) ;
301
301
}
302
302
}
303
303
}
@@ -311,7 +311,7 @@ fn handle_sleep(go_sleeping: bool, state: &mut State, matrix: &mut Foo, delay: &
311
311
( SleepState :: Awake , true ) => {
312
312
state. sleeping = SleepState :: Sleeping ( state. grid . clone ( ) ) ;
313
313
//state.grid = display_sleep();
314
- fill_grid ( & state. grid , matrix) ;
314
+ fill_grid_pixels ( & state. grid , matrix) ;
315
315
316
316
// Slowly decrease brightness
317
317
delay. delay_ms ( 1000 ) ;
@@ -335,7 +335,7 @@ fn handle_sleep(go_sleeping: bool, state: &mut State, matrix: &mut Foo, delay: &
335
335
// Restore back grid before sleeping
336
336
state. sleeping = SleepState :: Awake ;
337
337
state. grid = old_grid;
338
- fill_grid ( & state. grid , matrix) ;
338
+ fill_grid_pixels ( & state. grid , matrix) ;
339
339
340
340
// Slowly increase brightness
341
341
delay. delay_ms ( 1000 ) ;
0 commit comments