315: allow handlers to be named 'main' r=korken89 a=japaric
`#[init]`, `#[idle]` and `#[task]` handlers can now be named `main`
fixes#311
Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
320: No build opt on msrv r=korken89 a=AfoHT
#314 is failing the tests since 1.36.0 is not capable of 'build-override' profiles.
This extends current CI setup for both Travis and GHA to remove any `build-override` before running in case toolchain is 1.36.0.
322: Update resources.md r=korken89 a=lonesometraveler
This fixes some typos.
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Co-authored-by: KENTARO OKUDA <lonesometraveler@mac.com>
317: Use statically compiled mdbook r=perlindgren a=AfoHT
Instead of building mdbook, get a precompiled version
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
306: Retain cfg-attributes on resources r=korken89 a=AfoHT
When rust 1.43 lands as stable this will resolve#301 and allow for the kind of conditional compilation exemplified in the issue.
Tested on beta and nightly.
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
307: Use build.rs for conditional compilation r=korken89 a=AfoHT
Extend the current test suite to allow for running tests on newer rustc-versions than current MSRV.
Required by #306 to add special tests for future MSRV.
To exclude an example from the regular non-nightly testing:
```
#![no_main]
#![no_std]
#[cfg(rustc_is_nightly)]
mod example {
use panic_halt as _;
#[rtfm::app(device = lm3s6965)]
const APP: () = {
<more code>
}
}
```
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
305: Updated dead links to SLEEPONEXIT reference on developer.arm.com r=korken89 a=FluenTech
Co-authored-by: Peter Taylor <40178570+FluenTech@users.noreply.github.com>
284: book, Russian lang: fix "idle not defined" typo r=burbull a=kolen
Fix typo in Russian translation of book, was "When idle function is declared", should be "When no idle function is declared"
"не" means "not".
Corresponding text in English:
```markdown
When no `idle` function is declared, the runtime sets the [SLEEPONEXIT] bit and
then sends the microcontroller to sleep after running `init`.
```
Co-authored-by: Konstantin Mochalov <incredible.angst@gmail.com>
283: Include DWT enable in migration guide r=korken89 a=MabezDev
Makes note of the fact the DWT has to be enabled manually in rtfm 0.5.0; an easy one to miss considering debuggers generally enable the DWT automatically.
Co-authored-by: Scott Mabin <scott@mabez.dev>
277: TimerQueue.dequeue: don't set SYST reload to 0 r=korken89 a=mpasternacki
ARM Architecture Reference Manual says: "Setting SYST_RVR to zero has the effect of disabling the SysTick counter independently of the counter enable bit."
If Monotonic's ratio is less than one, the timeout calculations
can compute zero if next task is scheduled after current instant, but
before next timer tick. This results in disabling SYST and freezing the
timer queue.
The division by ratio's denominator rounds downward and the dequeue
condition is `if instant < now`. If ratio is small enough, this results
in unnecessary interrupts:
Let's say `instant - now` is 99 and ratio is 1/25. Then, `dur` will
equal 3 and the next tick will happen at `now + 75`. In the next
interrupt, `instant > now` and additional tick needs to be scheduled
(which doesn't happen, because now `instant - now` is less than 25, so
reload will be set to 0 and timer queue will stop). Adding one to
computed duration will prevent both freezing and additional interrupts.
When ratio is 1 or close, timer queue code overhead will prevent this
from happening. I am working with a chip where CPU is clocked at 600MHz
and SysTick is 100kHz and the freeze happens quite often.
Co-authored-by: Maciej Pasternacki <maciej@3ofcoins.net>
ARM Architecture Reference Manual says: "Setting SYST_RVR to zero has the effect of disabling the SysTick counter independently of the counter enable bit."
If Monotonic's ratio is less than one, the timeout calculations
can compute zero if next task is scheduled after current instant, but
before next timer tick. This results in disabling SYST and freezing the
timer queue.
278: Cyccnt r=texitoi a=perlindgren
The subtractions in `elapsed` and `duration` may cause an overflow panic in debug mode. This is solved by using wrapping arithmetics.
Co-authored-by: Per Lindgren <per.lindgren@ltu.se>