mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
Idle: Switch to NOP instead of WFI
Add example how to get old WFI behaviour
This commit is contained in:
parent
3741d431be
commit
8c8f7f12c3
6 changed files with 77 additions and 13 deletions
|
|
@ -85,7 +85,7 @@ pub fn codegen(
|
|||
vec![],
|
||||
None,
|
||||
quote!(loop {
|
||||
rtic::export::wfi()
|
||||
rtic::export::nop()
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,12 +122,5 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
|
|||
));
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no user `#[idle]` then optimize returning from interrupt handlers
|
||||
if app.idle.is_none() {
|
||||
// Set SLEEPONEXIT bit to enter sleep mode when returning from ISR
|
||||
stmts.push(quote!(core.SCB.scr.modify(|r| r | 1 << 1);));
|
||||
}
|
||||
|
||||
stmts
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue