Comments (4)
here I hope for your help to see how your usecases might be supported
As original author of this issue, my usecase doesn't exist anymore (I moved out of RTIC for different reasons). But for reference, my original usecase was: Use monotonic for defmt::timestamp!
and thus only use it when logging is enabled. The cfg
would have been something like #[cfg(feature = "defmt")]
. And in the init task I would call defmt::timestamp!
on monotonics::now()
, gated by feature = "defmt"
.
from rtic.
Scope goes beyond Monotonic. Also applies to Shared and Local. I also would like this.
from rtic.
Hi,
The cfg support in RTIC 1 is broken and on the path of wont-fix.
This usr case is already supported in (under development) RTIC 2, so I think it's best to go for that
from rtic.
As an experiment to see what can be done for RTIC 1 I've created #691
The obvious limitation, as shown in examples/cfg-monotonic
, is that rtic-syntax
does not know what is cfg-ed out, and thus "correctly" refuses code that uses the same type, or same interrupt. Might work for other cases, here I hope for your help to see how your usecases might be supported :)
From the example, showing the rtic-syntax errors
// A monotonic timer to enable scheduling in RTIC
#[cfg(feature = "killmono")]
#[monotonic(binds = SysTick, default = true)]
type MyMono = Systick<100>; // 100 Hz / 10 ms granularity
// Not allowed by current rtic-syntax:
// error: `#[monotonic(...)]` on a specific type must appear at most once
// --> examples/cfg-monotonic.rs:23:10
// |
// 23 | type MyMono = Systick<100>; // 100 Hz / 10 ms granularity
// | ^^^^^^
// #[monotonic(binds = SysTick, default = true)]
// type MyMono = Systick<100>; // 100 Hz / 10 ms granularity
// Not allowed by current rtic-syntax:
// error: this interrupt is already bound
// --> examples/cfg-monotonic.rs:31:25
// |
// 31 | #[monotonic(binds = SysTick, default = true)]
// | ^^^^^^^
// #[monotonic(binds = SysTick, default = true)]
// type MyMono2 = DwtSystick<100>; // 100 Hz / 10 ms granularity
from rtic.
Related Issues (20)
- Link errors when running rtic-monotonics example HOT 2
- "Cannot compile. No backend feature selected." error when running the examples HOT 1
- Generic type in Shared HOT 1
- Monotonic delays are too short
- Race condition in `nrf:rtc` and `nrf:timer` monotonics
- Pi pico example: cannot find trait `DelayUs` in module `embedded_hal::delay` HOT 2
- `rtic_monotonic::nrf::rtc` errata workaround is probably not what was intended
- Higher resolution monotonic timer (on stm32) HOT 9
- rtic migration strategy for eh-1.0 HOT 3
- Local variable coruption in software tasks (async functions) HOT 1
- Monotonics: non-hardcoded tick rate HOT 2
- Clean application shutdown HOT 2
- embedded-hal-bus with rtic v2 in embedded-hal 1.0.0 HOT 14
- timeout_after memory usage HOT 1
- nested lock() can allow access to unlocked resources HOT 5
- `docs.rs` page for `rtic` v2.1.1 is not available
- broken usage example for i2c sharing HOT 2
- Software/Hardware Task interfaction with RTIC v2 HOT 2
- How to invoke code before RTIC main part. HOT 1
- Docs: Examples are broken and not showing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtic.