Skip to content

Commit fb97b80

Browse files
committed
the types of core peripherals in cortex-m are now uppercase
1 parent 7decae4 commit fb97b80

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/generate.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ use svd::{Access, BitRange, Defaults, Device, EnumeratedValues, Field,
99
use syn::{Ident, Lit};
1010

1111
use errors::*;
12-
use util::{self, ToSanitizedPascalCase, ToSanitizedSnakeCase,
13-
ToSanitizedUpperCase, U32Ext};
12+
use util::{self, ToSanitizedSnakeCase, ToSanitizedUpperCase, U32Ext};
1413

1514
/// Whole device generation
1615
pub fn device(d: &Device, items: &mut Vec<Tokens>) -> Result<()> {
@@ -62,11 +61,9 @@ pub fn device(d: &Device, items: &mut Vec<Tokens>) -> Result<()> {
6261
];
6362

6463
for p in CORE_PERIPHERALS {
65-
let ty_ = Ident::new(p.to_sanitized_pascal_case());
6664
let p = Ident::new(*p);
6765

6866
items.push(quote! {
69-
pub use cortex_m::peripheral::#ty_ as #p;
7067
pub use cortex_m::peripheral::#p;
7168
});
7269
}
@@ -157,16 +154,16 @@ pub fn interrupt(peripherals: &[Peripheral], items: &mut Vec<Tokens>) {
157154
#[no_mangle]
158155
extern "C" fn #names() {
159156
unsafe {
160-
asm!("b DEFAULT_HANDLER");
157+
asm!("b DEFAULT_HANDLER" :::: "volatile");
161158
::core::intrinsics::unreachable()
162159
}
163160
}
164161
)*
165162

166-
#[doc(hidden)]
167163
#[link_section = ".vector_table.interrupts"]
168164
#[no_mangle]
169-
pub static INTERRUPTS: [Option<unsafe extern "C" fn()>; #n] = [
165+
#[used]
166+
static INTERRUPTS: [Option<extern "C" fn()>; #n] = [
170167
#(#elements,)*
171168
];
172169

0 commit comments

Comments
 (0)