Fixed examples and added defmt format to the new error types
This commit is contained in:
parent
4950682a50
commit
e6ec81b999
@ -25,6 +25,7 @@ pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Pari
|
|||||||
|
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
PpiError(ppi::Error),
|
PpiError(ppi::Error),
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
|
|||||||
/// Error type of the PPI driver
|
/// Error type of the PPI driver
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// There is no capacity to enable this task or event (nRF51 & nRF52 only)
|
/// There is no capacity to enable this task or event (nRF51 & nRF52 only)
|
||||||
NoCapacityLeft,
|
NoCapacityLeft,
|
||||||
|
@ -27,6 +27,7 @@ pub use pac::uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Pari
|
|||||||
|
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
PpiError(crate::ppi::Error),
|
PpiError(crate::ppi::Error),
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
|||||||
let irq = interrupt::take!(UARTE0_UART0);
|
let irq = interrupt::take!(UARTE0_UART0);
|
||||||
let mut state = State::new();
|
let mut state = State::new();
|
||||||
let u = unsafe {
|
let u = unsafe {
|
||||||
BufferedUarte::new(
|
unwrap!(BufferedUarte::new(
|
||||||
&mut state,
|
&mut state,
|
||||||
p.UARTE0,
|
p.UARTE0,
|
||||||
p.TIMER0,
|
p.TIMER0,
|
||||||
@ -40,7 +40,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
|||||||
config,
|
config,
|
||||||
&mut rx_buffer,
|
&mut rx_buffer,
|
||||||
&mut tx_buffer,
|
&mut tx_buffer,
|
||||||
)
|
))
|
||||||
};
|
};
|
||||||
pin_mut!(u);
|
pin_mut!(u);
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ async fn main(_spawner: Spawner, p: Peripherals) {
|
|||||||
|
|
||||||
let irq = interrupt::take!(UARTE0_UART0);
|
let irq = interrupt::take!(UARTE0_UART0);
|
||||||
let mut uart = unsafe {
|
let mut uart = unsafe {
|
||||||
uarte::UarteWithIdle::new(
|
unwrap!(uarte::UarteWithIdle::new(
|
||||||
p.UARTE0, p.TIMER0, p.PPI_CH0, p.PPI_CH1, irq, p.P0_08, p.P0_06, NoPin, NoPin, config,
|
p.UARTE0, p.TIMER0, p.PPI_CH0, p.PPI_CH1, irq, p.P0_08, p.P0_06, NoPin, NoPin, config,
|
||||||
)
|
))
|
||||||
};
|
};
|
||||||
|
|
||||||
info!("uarte initialized!");
|
info!("uarte initialized!");
|
||||||
|
Loading…
Reference in New Issue
Block a user