diff options
author | 2019-06-20 06:19:59 +0200 | |
---|---|---|
committer | 2019-06-20 06:19:59 +0200 | |
commit | 4e51bb68b976c6bb6a9a989dc560d2a8123a84ca (patch) | |
tree | 5c14f21f904c15034d477c7e4400e01d212a9f2a /macros/src/codegen/util.rs | |
parent | b150ab29e25637e41ba5de81f6cbbdfe24834a3f (diff) | |
download | rtic-4e51bb68b976c6bb6a9a989dc560d2a8123a84ca.tar.gz rtic-4e51bb68b976c6bb6a9a989dc560d2a8123a84ca.tar.zst rtic-4e51bb68b976c6bb6a9a989dc560d2a8123a84ca.zip |
RFC #207
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r-- | macros/src/codegen/util.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 8c43b350..cd01264d 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -113,6 +113,18 @@ pub fn interrupt_ident(core: Core, cores: u8) -> Ident { } } +/// Whether `name` is an exception with configurable priority +pub fn is_exception(name: &Ident) -> bool { + let s = name.to_string(); + + match &*s { + "MemoryManagement" | "BusFault" | "UsageFault" | "SecureFault" | "SVCall" + | "DebugMonitor" | "PendSV" | "SysTick" => true, + + _ => false, + } +} + /// Generates a pre-reexport identifier for the "late resources" struct pub fn late_resources_ident(init: &Ident) -> Ident { Ident::new( |