Don't include extended timer support on chips without it

This commit is contained in:
Liam Murphy 2021-06-29 12:07:10 +10:00
parent 94e13ef053
commit 0c0597f775

View File

@ -206,7 +206,19 @@ impl<'d, T: Instance> Timer<'d, T> {
1 => w.compare1().clear(), 1 => w.compare1().clear(),
2 => w.compare2().clear(), 2 => w.compare2().clear(),
3 => w.compare3().clear(), 3 => w.compare3().clear(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4().clear(), 4 => w.compare4().clear(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5().clear(), 5 => w.compare5().clear(),
_ => unreachable!("No timers have more than 6 CC registers"), _ => unreachable!("No timers have more than 6 CC registers"),
}); });
@ -291,7 +303,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1_clear().enabled(), 1 => w.compare1_clear().enabled(),
2 => w.compare2_clear().enabled(), 2 => w.compare2_clear().enabled(),
3 => w.compare3_clear().enabled(), 3 => w.compare3_clear().enabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4_clear().enabled(), 4 => w.compare4_clear().enabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5_clear().enabled(), 5 => w.compare5_clear().enabled(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}) })
@ -304,7 +328,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1_clear().disabled(), 1 => w.compare1_clear().disabled(),
2 => w.compare2_clear().disabled(), 2 => w.compare2_clear().disabled(),
3 => w.compare3_clear().disabled(), 3 => w.compare3_clear().disabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4_clear().disabled(), 4 => w.compare4_clear().disabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5_clear().disabled(), 5 => w.compare5_clear().disabled(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}) })
@ -321,7 +357,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1_stop().enabled(), 1 => w.compare1_stop().enabled(),
2 => w.compare2_stop().enabled(), 2 => w.compare2_stop().enabled(),
3 => w.compare3_stop().enabled(), 3 => w.compare3_stop().enabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4_stop().enabled(), 4 => w.compare4_stop().enabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5_stop().enabled(), 5 => w.compare5_stop().enabled(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}) })
@ -334,7 +382,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1_stop().disabled(), 1 => w.compare1_stop().disabled(),
2 => w.compare2_stop().disabled(), 2 => w.compare2_stop().disabled(),
3 => w.compare3_stop().disabled(), 3 => w.compare3_stop().disabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4_stop().disabled(), 4 => w.compare4_stop().disabled(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5_stop().disabled(), 5 => w.compare5_stop().disabled(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}) })
@ -352,7 +412,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1().set(), 1 => w.compare1().set(),
2 => w.compare2().set(), 2 => w.compare2().set(),
3 => w.compare3().set(), 3 => w.compare3().set(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4().set(), 4 => w.compare4().set(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5().set(), 5 => w.compare5().set(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}); });
@ -364,7 +436,19 @@ impl<'a, T: Instance> Cc<'a, T> {
1 => w.compare1().clear(), 1 => w.compare1().clear(),
2 => w.compare2().clear(), 2 => w.compare2().clear(),
3 => w.compare3().clear(), 3 => w.compare3().clear(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
4 => w.compare4().clear(), 4 => w.compare4().clear(),
#[cfg(any(
feature = "nrf52805",
feature = "nrf52811",
feature = "nrf52820",
feature = "nrf52833",
))]
5 => w.compare5().clear(), 5 => w.compare5().clear(),
_ => unreachable!("a `Cc` cannot be created with `n > 5`"), _ => unreachable!("a `Cc` cannot be created with `n > 5`"),
}); });