File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ use syn::{
91
91
/// pre-interrupt initialization to be done.
92
92
///
93
93
/// Note that a function marked with the entry attribute is allowed to take no input parameters
94
- /// even if `init` returns a value, due to implementation details.
94
+ /// even if `init` returns a value, due to implementation details. To reduce code size, it is
95
+ /// strongly recommended to put `#[inline(always)]` on `init` if it's used nowhere else.
95
96
///
96
97
/// ## Examples
97
98
///
@@ -115,6 +116,7 @@ use syn::{
115
116
/// use msp430::interrupt::CriticalSection;
116
117
///
117
118
/// # struct Hal;
119
+ /// #[inline(always)]
118
120
/// fn init(cs: CriticalSection) -> Hal {
119
121
/// /* initialize hardware */
120
122
/// # Hal
@@ -135,6 +137,7 @@ use syn::{
135
137
/// # use msp430_rt_macros::entry;
136
138
/// use msp430::interrupt::CriticalSection;
137
139
///
140
+ /// #[inline(always)]
138
141
/// fn arg(cs: CriticalSection) {
139
142
/// /* initialize */
140
143
/// }
@@ -494,6 +497,7 @@ pub fn interrupt(args: TokenStream, input: TokenStream) -> TokenStream {
494
497
#unsafety extern "msp430-interrupt" fn #hash( ) {
495
498
#check
496
499
500
+ #[ inline( always) ]
497
501
#unsafety fn #hash<' a>( #fn_param) #output {
498
502
#( #vars) *
499
503
#( #stmts) *
You can’t perform that action at this time.
0 commit comments