Skip to content

Commit f4ce2df

Browse files
Merge #198
198: Syst small fix r=adamgreig a=thalesfragoso To comply with `cortex-m` docs (https://docs.rs/cortex-m/0.6.0/cortex_m/peripheral/struct.SYST.html) > NOTE The reference manual indicates that: > >"The SysTick counter reload and current value are undefined at reset, the correct initialization >sequence for the SysTick counter is: > > Program reload value > Clear current value > Program Control and Status register" > >The sequence translates to self.set_reload(x); self.clear_current(); self.enable_counter() I think this just slipped through, since the other example on systick does that. Co-authored-by: thalesfragoso <thales.fragosoz@gmail.com>
2 parents ff334e7 + 1b25e04 commit f4ce2df

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/start/exceptions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fn main() -> ! {
8282
syst.set_clock_source(SystClkSource::Core);
8383
// this is configured for the LM3S6965 which has a default CPU clock of 12 MHz
8484
syst.set_reload(12_000_000);
85+
syst.clear_current();
8586
syst.enable_counter();
8687
syst.enable_interrupt();
8788

0 commit comments

Comments
 (0)