aboutsummaryrefslogtreecommitdiff
path: root/src/macros.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-16Move cortex-m crate into cortex-m directoryGravatar Adam Greig 1-117/+0
2022-08-22Use a `mod _export` for macro reexports.Gravatar Dario Nieuwenhuis 1-1/+1
This avoids having to do `#[doc(hidden)] pub mod critical_section` which is a bit strange.
2022-08-22Fix outdated comment in `singleton!`.Gravatar Dario Nieuwenhuis 1-1/+4
2022-08-11Add implementation for critical-section 1.0Gravatar Dario Nieuwenhuis 1-1/+1
Co-Authored-By: Markus Reiter <me@reitermark.us>
2022-01-04macros: Don't use Option in singleton!()Gravatar Rahix 1-8/+9
As detailed in rust-embedded/cortex-m#364, niche optimization of the `Option` used in the `singleton!()` macro can lead to the initial value of the static to contain non-zero bits. This in turn leads to the whole static being moved from `.bss` to `.data` which means it eats up flash space for no reason. Especially if the singleton stores a particularly large type, this can be quite problematic. Prevent this by using an explicit boolean flag instead of the `Option` type. This is not quite as nice but at least there is no chance for the `singleton!()` to end up in `.data`...
2022-01-03macros: Allow setting a name for singleton!() staticsGravatar Rahix 1-6/+17
Right now, the `singleton!()` macro always creates a static named `VAR`. This is annoying when digging through objdump output or digging into memory with a debugger because it is hard to see what singleton you're looking at when they are all called `<...>::{{closure}}::VAR`. To make it a bit nicer, allow setting the name of the generated static to some meaningful identifier which can then be cross-referenced in debugger output, for example with singleton!(FOO_BUFFER: [u8; 1024] = [0u8; 1024]); There is no other side-effects to this change - the identifier is never visible to other code because it is still contained in the closure of the macro.
2021-11-12add noteGravatar gnxlxnxx 1-0/+3
the same note as in https://github.com/rust-embedded/riscv/pull/87
2019-10-29Make clippy happy, again.Gravatar Mara Bos 1-4/+0
2019-07-29Update for 2018 editionGravatar Adam Greig 1-6/+3
2018-09-06make `iprintln!` not depend on `iprint!`Gravatar Jorge Aparicio 1-3/+3
the preferred way to import macros in Rust 2018 is via `use`. If you import `iprintln` and try to use you'll get an error if the `iprint` macro has not been imported as well. This commit makes `iprintln` work w/o having to import `iprint` as well.
2018-05-11stable by default, remove exception module, add SCB.vect_active, ..Gravatar Jorge Aparicio 1-4/+7
tweak Exception enum to match CMSIS names, document the parts of the API that require opting into `"inline-asm"`.
2018-04-26make singleton! work on stableGravatar Jorge Aparicio 1-15/+4
2018-04-26make compilable on stableGravatar Jorge Aparicio 1-1/+5
2018-01-25don't trip the unsafe_code lintGravatar Jorge Aparicio 1-4/+41
2018-01-23singleton!: check that calls to unsafe functions require an unsafe blockGravatar Jorge Aparicio 1-5/+9
2018-01-23initialize singletons at runtimeGravatar Jorge Aparicio 1-2/+3
2018-01-15address review commentsGravatar Jorge Aparicio 1-5/+8
2017-12-23safe `&'static mut` references through a runtime checked macroGravatar Jorge Aparicio 1-0/+41
2017-07-04remove re-export of cortex-m-semihostingGravatar Jorge Aparicio 1-48/+0
the functionality is not fundamental and can be easily added to a program by directly depending on cortex-m-semihosting
2017-06-16Fix typo in ehprint! macroGravatar Nicolas Schodet 1-1/+1
2017-03-10reformatGravatar Jorge Aparicio 1-9/+27
2017-03-08add macros for writing to an ITM portGravatar Jorge Aparicio 1-0/+25
2017-02-28changes to better integrate with svd2rustGravatar Jorge Aparicio 1-0/+29