mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 14:25:18 +01:00
Move entry-point main into a separate module
Prevents conflict with user provided tasks named main
This commit is contained in:
parent
9527c92192
commit
f957f05b66
2 changed files with 37 additions and 8 deletions
|
|
@ -57,19 +57,22 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
|||
|
||||
let main = util::suffixed("main");
|
||||
mains.push(quote!(
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn #main() -> ! {
|
||||
let _TODO: () = ();
|
||||
pub mod rtic_ext {
|
||||
use super::*;
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn #main() -> ! {
|
||||
let _TODO: () = ();
|
||||
|
||||
#(#assertion_stmts)*
|
||||
#(#assertion_stmts)*
|
||||
|
||||
#(#pre_init_stmts)*
|
||||
#(#pre_init_stmts)*
|
||||
|
||||
#call_init
|
||||
#call_init
|
||||
|
||||
#(#post_init_stmts)*
|
||||
#(#post_init_stmts)*
|
||||
|
||||
#call_idle
|
||||
#call_idle
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue