aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/pre_init.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-08 20:49:13 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-08 20:49:13 +0100
commitb23bb1192c8dc1f2e8f157db2147b1737abc1033 (patch)
treefa0f369feddc3bf838c74a3c5325c60735edc8ab /macros/src/codegen/pre_init.rs
parentef50aeb2e8245b69843280fabb62589c0716ffdd (diff)
downloadrtic-b23bb1192c8dc1f2e8f157db2147b1737abc1033.tar.gz
rtic-b23bb1192c8dc1f2e8f157db2147b1737abc1033.tar.zst
rtic-b23bb1192c8dc1f2e8f157db2147b1737abc1033.zip
TQ handlers being generated
Diffstat (limited to 'macros/src/codegen/pre_init.rs')
-rw-r--r--macros/src/codegen/pre_init.rs37
1 files changed, 19 insertions, 18 deletions
diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs
index 969de84a..dfdb30a0 100644
--- a/macros/src/codegen/pre_init.rs
+++ b/macros/src/codegen/pre_init.rs
@@ -74,24 +74,25 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
);));
}
- // Initialize the SysTick if there exist a TimerQueue
- if extra.monotonic.is_some() {
- let priority = analysis.channels.keys().max().unwrap();
-
- // Compile time assert that this priority is supported by the device
- stmts.push(quote!(let _ = [(); ((1 << #nvic_prio_bits) - #priority as usize)];));
-
- stmts.push(quote!(core.SCB.set_priority(
- rtic::export::SystemHandler::SysTick,
- rtic::export::logical2hw(#priority, #nvic_prio_bits),
- );));
-
- stmts.push(quote!(
- core.SYST.set_clock_source(rtic::export::SystClkSource::Core);
- core.SYST.enable_counter();
- core.DCB.enable_trace();
- ));
- }
+ // TODO: Update for noew monotonic
+ // // Initialize the SysTick if there exist a TimerQueue
+ // if extra.monotonic.is_some() {
+ // let priority = analysis.channels.keys().max().unwrap();
+
+ // // Compile time assert that this priority is supported by the device
+ // stmts.push(quote!(let _ = [(); ((1 << #nvic_prio_bits) - #priority as usize)];));
+
+ // stmts.push(quote!(core.SCB.set_priority(
+ // rtic::export::SystemHandler::SysTick,
+ // rtic::export::logical2hw(#priority, #nvic_prio_bits),
+ // );));
+
+ // stmts.push(quote!(
+ // core.SYST.set_clock_source(rtic::export::SystClkSource::Core);
+ // core.SYST.enable_counter();
+ // core.DCB.enable_trace();
+ // ));
+ // }
// If there's no user `#[idle]` then optimize returning from interrupt handlers
if app.idles.is_empty() {