Merge pull request #1302 from embassy-rs/update-stm32-pac
Update stm32-metapac
This commit is contained in:
commit
732614579b
@ -60,7 +60,7 @@ sdio-host = "0.5.0"
|
|||||||
embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "46d1b1c2ff13e31e282ec1e352421721694f126a", optional = true }
|
embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "46d1b1c2ff13e31e282ec1e352421721694f126a", optional = true }
|
||||||
critical-section = "1.1"
|
critical-section = "1.1"
|
||||||
atomic-polyfill = "1.0.1"
|
atomic-polyfill = "1.0.1"
|
||||||
stm32-metapac = { version = "1", features = ["rt"] }
|
stm32-metapac = { version = "2", features = ["rt"] }
|
||||||
vcell = "0.1.3"
|
vcell = "0.1.3"
|
||||||
bxcan = "0.7.0"
|
bxcan = "0.7.0"
|
||||||
nb = "1.0.0"
|
nb = "1.0.0"
|
||||||
@ -72,7 +72,7 @@ embedded-io = { version = "0.4.0", features = ["async"], optional = true }
|
|||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
proc-macro2 = "1.0.36"
|
proc-macro2 = "1.0.36"
|
||||||
quote = "1.0.15"
|
quote = "1.0.15"
|
||||||
stm32-metapac = { version = "1", default-features = false, features = ["metadata"]}
|
stm32-metapac = { version = "2", default-features = false, features = ["metadata"]}
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embassy-hal-common/defmt", "embedded-io?/defmt", "embassy-usb-driver?/defmt", "embassy-net-driver/defmt"]
|
defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embassy-hal-common/defmt", "embedded-io?/defmt", "embassy-usb-driver?/defmt", "embassy-net-driver/defmt"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
macro_rules! impl_sample_time {
|
macro_rules! impl_sample_time {
|
||||||
($default_doc:expr, $default:ident, $pac:ty, ($(($doc:expr, $variant:ident, $pac_variant:ident)),*)) => {
|
($default_doc:expr, $default:ident, ($(($doc:expr, $variant:ident, $pac_variant:ident)),*)) => {
|
||||||
#[doc = concat!("ADC sample time\n\nThe default setting is ", $default_doc, " ADC clock cycles.")]
|
#[doc = concat!("ADC sample time\n\nThe default setting is ", $default_doc, " ADC clock cycles.")]
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
|
||||||
pub enum SampleTime {
|
pub enum SampleTime {
|
||||||
@ -9,10 +9,10 @@ macro_rules! impl_sample_time {
|
|||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<SampleTime> for $pac {
|
impl From<SampleTime> for crate::pac::adc::vals::SampleTime {
|
||||||
fn from(sample_time: SampleTime) -> $pac {
|
fn from(sample_time: SampleTime) -> crate::pac::adc::vals::SampleTime {
|
||||||
match sample_time {
|
match sample_time {
|
||||||
$(SampleTime::$variant => <$pac>::$pac_variant),*
|
$(SampleTime::$variant => crate::pac::adc::vals::SampleTime::$pac_variant),*
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -29,7 +29,6 @@ macro_rules! impl_sample_time {
|
|||||||
impl_sample_time!(
|
impl_sample_time!(
|
||||||
"1.5",
|
"1.5",
|
||||||
Cycles1_5,
|
Cycles1_5,
|
||||||
crate::pac::adc::vals::SampleTime,
|
|
||||||
(
|
(
|
||||||
("1.5", Cycles1_5, CYCLES1_5),
|
("1.5", Cycles1_5, CYCLES1_5),
|
||||||
("7.5", Cycles7_5, CYCLES7_5),
|
("7.5", Cycles7_5, CYCLES7_5),
|
||||||
@ -46,7 +45,6 @@ impl_sample_time!(
|
|||||||
impl_sample_time!(
|
impl_sample_time!(
|
||||||
"3",
|
"3",
|
||||||
Cycles3,
|
Cycles3,
|
||||||
crate::pac::adc::vals::Smp,
|
|
||||||
(
|
(
|
||||||
("3", Cycles3, CYCLES3),
|
("3", Cycles3, CYCLES3),
|
||||||
("15", Cycles15, CYCLES15),
|
("15", Cycles15, CYCLES15),
|
||||||
@ -63,7 +61,6 @@ impl_sample_time!(
|
|||||||
impl_sample_time!(
|
impl_sample_time!(
|
||||||
"2.5",
|
"2.5",
|
||||||
Cycles2_5,
|
Cycles2_5,
|
||||||
crate::pac::adc::vals::SampleTime,
|
|
||||||
(
|
(
|
||||||
("2.5", Cycles2_5, CYCLES2_5),
|
("2.5", Cycles2_5, CYCLES2_5),
|
||||||
("6.5", Cycles6_5, CYCLES6_5),
|
("6.5", Cycles6_5, CYCLES6_5),
|
||||||
@ -80,7 +77,6 @@ impl_sample_time!(
|
|||||||
impl_sample_time!(
|
impl_sample_time!(
|
||||||
"1.5",
|
"1.5",
|
||||||
Cycles1_5,
|
Cycles1_5,
|
||||||
crate::pac::adc::vals::SampleTime,
|
|
||||||
(
|
(
|
||||||
("1.5", Cycles1_5, CYCLES1_5),
|
("1.5", Cycles1_5, CYCLES1_5),
|
||||||
("3.5", Cycles3_5, CYCLES3_5),
|
("3.5", Cycles3_5, CYCLES3_5),
|
||||||
@ -97,7 +93,6 @@ impl_sample_time!(
|
|||||||
impl_sample_time!(
|
impl_sample_time!(
|
||||||
"1.5",
|
"1.5",
|
||||||
Cycles1_5,
|
Cycles1_5,
|
||||||
crate::pac::adc::vals::Smp,
|
|
||||||
(
|
(
|
||||||
("1.5", Cycles1_5, CYCLES1_5),
|
("1.5", Cycles1_5, CYCLES1_5),
|
||||||
("2.5", Cycles2_5, CYCLES2_5),
|
("2.5", Cycles2_5, CYCLES2_5),
|
||||||
|
Loading…
Reference in New Issue
Block a user