Update backend features to be more clear

This commit is contained in:
Emil Fresk 2023-02-20 20:56:18 +01:00 committed by Henrik Tjäder
parent 9552790dcc
commit 4442c46926
6 changed files with 31 additions and 32 deletions

View file

@ -23,16 +23,15 @@ proc-macro = true
[features]
default = []
debugprint = []
# list of supported codegen backends
cortex_m_source_masking = []
cortex_m_basepri = []
# riscv_clic = []
# riscv_ch32 = []
cortex-m-source-masking = []
cortex-m-basepri = []
# riscv-clic = []
# riscv-ch32 = []
# backend API test
test_template = []
test-template = []
[dependencies]
indexmap = "1.9.2"

View file

@ -1,18 +1,18 @@
#[cfg(not(any(
feature = "cortex_m_source_masking",
feature = "cortex_m_basepri",
feaute = "test_template"
feature = "cortex-m-source-masking",
feature = "cortex-m-basepri",
feaute = "test-template"
)))]
compile_error!("No backend selected");
#[cfg(any(feature = "cortex_m_source_masking", feature = "cortex_m_basepri"))]
#[cfg(any(feature = "cortex-m-source-masking", feature = "cortex-m-basepri"))]
pub use cortex::*;
#[cfg(feature = "test_template")]
#[cfg(feature = "test-template")]
pub use cortex::*;
#[cfg(any(feature = "cortex_m_source_masking", feature = "cortex_m_basepri"))]
#[cfg(any(feature = "cortex-m-source-masking", feature = "cortex-m-basepri"))]
mod cortex;
#[cfg(feature = "test_template")]
#[cfg(feature = "test-template")]
mod template;

View file

@ -8,9 +8,9 @@ use quote::quote;
use std::collections::HashSet;
use syn::{parse, Attribute, Ident};
#[cfg(feature = "cortex_m_basepri")]
#[cfg(feature = "cortex-m-basepri")]
pub use basepri::*;
#[cfg(feature = "cortex_m_source_masking")]
#[cfg(feature = "cortex-m-source-masking")]
pub use source_masking::*;
/// Whether `name` is an exception with configurable priority
@ -30,7 +30,7 @@ fn is_exception(name: &Ident) -> bool {
)
}
#[cfg(feature = "cortex_m_source_masking")]
#[cfg(feature = "cortex-m-source-masking")]
mod source_masking {
use super::*;
use std::collections::HashMap;
@ -119,7 +119,7 @@ mod source_masking {
}
}
#[cfg(feature = "cortex_m_basepri")]
#[cfg(feature = "cortex-m-basepri")]
mod basepri {
use super::*;