File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ fn main() -> ! {
3737
3838 let ( clocks, gpio, ethernet) = common:: setup_peripherals ( p) ;
3939
40- setup_systick ( & mut cp. SYST ) ;
40+ setup_systick ( & mut cp. SYST , clocks . hclk ( ) . to_Hz ( ) ) ;
4141
4242 defmt:: info!( "Enabling ethernet..." ) ;
4343 let ( eth_pins, mdio, mdc, _) = common:: setup_pins ( gpio) ;
@@ -68,6 +68,7 @@ fn main() -> ! {
6868 // print stats every 30 seconds
6969 if time >= last_stats_time + 30 {
7070 let t = time - last_stats_time;
71+
7172 defmt:: info!(
7273 "T={}\t Rx:\t {} KB/s\t {} pps\t Tx:\t {} KB/s\t {} pps" ,
7374 time,
@@ -142,8 +143,8 @@ fn main() -> ! {
142143 }
143144}
144145
145- fn setup_systick ( syst : & mut SYST ) {
146- syst. set_reload ( 100 * SYST :: get_ticks_per_10ms ( ) ) ;
146+ fn setup_systick ( syst : & mut SYST , hclk : u32 ) {
147+ syst. set_reload ( hclk . min ( 0x00FF_FFFF ) ) ;
147148 syst. enable_counter ( ) ;
148149 syst. enable_interrupt ( ) ;
149150
You can’t perform that action at this time.
0 commit comments