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() -> ! {
37
37
38
38
let ( clocks, gpio, ethernet) = common:: setup_peripherals ( p) ;
39
39
40
- setup_systick ( & mut cp. SYST ) ;
40
+ setup_systick ( & mut cp. SYST , clocks . hclk ( ) . to_Hz ( ) ) ;
41
41
42
42
defmt:: info!( "Enabling ethernet..." ) ;
43
43
let ( eth_pins, mdio, mdc, _) = common:: setup_pins ( gpio) ;
@@ -68,6 +68,7 @@ fn main() -> ! {
68
68
// print stats every 30 seconds
69
69
if time >= last_stats_time + 30 {
70
70
let t = time - last_stats_time;
71
+
71
72
defmt:: info!(
72
73
"T={}\t Rx:\t {} KB/s\t {} pps\t Tx:\t {} KB/s\t {} pps" ,
73
74
time,
@@ -142,8 +143,8 @@ fn main() -> ! {
142
143
}
143
144
}
144
145
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 ) ) ;
147
148
syst. enable_counter ( ) ;
148
149
syst. enable_interrupt ( ) ;
149
150
You can’t perform that action at this time.
0 commit comments