We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i'm trying to make driver for embassy_time https://github.com/djdisodo/avr_tc0_embassy_time
for example on arduino uno, the source clock is 16MHz
and if i use 64 Prescalar that's 16MHz/64 so 250000Hz
(i used 256_000Hz for testing, which should be close enough)
i can just upscale/downscale the ticks every time but it adds a bit of complexity,
also i don't want to create preset to account for different source clock
i have an idea,
it's still nightly feature but by using proc_macro_tracked_env
proc_macro_tracked_env
macro crate link
const TICK_HZ: usize = env_int!(TICK_HZ, 16000000);
you can do something like this, this will default to 16000000 if TICK_HZ environment variable isn't defined
and will use TICK_HZ as value if possible, only recompiles when TICK_HZ value is changed
The text was updated successfully, but these errors were encountered:
I'd prefer to not add a new dependency just for this. It's possible to do it with no deps, from build.rs. See how ekv does it: https://github.com/embassy-rs/ekv/blob/main/build.rs
ekv
If you want to send a PR for that, it'd be great.
Also, we can simply add the needed tick rates too.
Sorry, something went wrong.
No branches or pull requests
i'm trying to make driver for embassy_time
https://github.com/djdisodo/avr_tc0_embassy_time
for example on arduino uno, the source clock is 16MHz
and if i use 64 Prescalar that's 16MHz/64 so 250000Hz
(i used 256_000Hz for testing, which should be close enough)
i can just upscale/downscale the ticks every time but it adds a bit of complexity,
also i don't want to create preset to account for different source clock
i have an idea,
it's still nightly feature but by using
proc_macro_tracked_env
macro crate link
you can do something like this, this will default to 16000000 if TICK_HZ environment variable isn't defined
and will use TICK_HZ as value if possible, only recompiles when TICK_HZ value is changed
The text was updated successfully, but these errors were encountered: