@@ -274,7 +274,7 @@ fn main() -> ! {
274274 // ×126 (=1512 MHz), ÷6 (=252 MHz), ÷2 (=126 MHz)
275275 let pll_sys = hal:: pll:: setup_pll_blocking (
276276 pp. PLL_SYS ,
277- xosc. operating_frequency ( ) . into ( ) ,
277+ xosc. operating_frequency ( ) ,
278278 hal:: pll:: PLLConfig {
279279 vco_freq : 1512 . MHz ( ) ,
280280 refdiv : 1 ,
@@ -289,7 +289,7 @@ fn main() -> ! {
289289 // Step 5. Set up a 48 MHz PLL for the USB system.
290290 let pll_usb = hal:: pll:: setup_pll_blocking (
291291 pp. PLL_USB ,
292- xosc. operating_frequency ( ) . into ( ) ,
292+ xosc. operating_frequency ( ) ,
293293 hal:: pll:: common_configs:: PLL_USB_48MHZ ,
294294 & mut clocks,
295295 & mut pp. RESETS ,
@@ -617,7 +617,7 @@ impl Hardware {
617617 /// These are connected to the bit 4 of GPIOA on the MCP23S17.
618618 fn set_hdd_led ( & mut self , enabled : bool ) {
619619 // LEDs are active-low.
620- self . debug_leds = ( self . debug_leds & 0x17 ) | if enabled { 0 } else { 1 } ;
620+ self . debug_leds = ( self . debug_leds & 0x17 ) | u8 :: from ( enabled) ;
621621 self . io_chip_write ( 0x12 , self . debug_leds << 3 | self . last_cs ) ;
622622 }
623623
@@ -698,7 +698,7 @@ impl Hardware {
698698 defmt:: info!( "buffer: {=[u8]:x}" , buffer) ;
699699 let mut result = & buffer[ ..] ;
700700 let mut latency = 0 ;
701- while result. len ( ) > 0 && ( ( result[ 0 ] == 0xFF ) || ( result[ 0 ] == 0x00 ) ) {
701+ while ! result. is_empty ( ) && ( ( result[ 0 ] == 0xFF ) || ( result[ 0 ] == 0x00 ) ) {
702702 latency += 1 ;
703703 result = & result[ 1 ..] ;
704704 }
@@ -749,7 +749,7 @@ impl Hardware {
749749 defmt:: trace!( "buffer: {=[u8]:x}" , buffer) ;
750750 let mut result = & buffer[ ..] ;
751751 let mut latency = 0 ;
752- while result. len ( ) > 0 && result[ 0 ] == 0xFF {
752+ while ! result. is_empty ( ) && ( result[ 0 ] == 0xFF || result [ 0 ] == 0x00 ) {
753753 latency += 1 ;
754754 result = & result[ 1 ..] ;
755755 }
0 commit comments