Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement defmt formatting and Debug for clocks::InitError #751

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rp2040-hal/examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The delay object lets us wait for specified amounts of time (in
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/adc_fifo_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The delay object lets us wait for specified amounts of time (in
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/adc_fifo_irq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ mod app {
&mut resets,
&mut watchdog,
)
.ok()
.unwrap();
let sio = hal::Sio::new(c.device.SIO);
let pins = hal::gpio::Pins::new(
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/adc_fifo_poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The delay object lets us wait for specified amounts of time (in
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let mut timer = rp2040_hal::Timer::new(pac.TIMER, &mut pac.RESETS, &clocks);
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/dht11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/gpio_dyn_pin_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// We will use the RP2040 timer peripheral as our delay source
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/gpio_in_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/gpio_irq_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/lcd_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The delay object lets us wait for specified amounts of time (in
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/mem_to_mem_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// Setup the pins.
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/multicore_fifo_blink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let sys_freq = clocks.system_clock.freq().to_Hz();
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/multicore_polyblink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// Set up the GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/pwm_blink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/pwm_blink_embedded_hal_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/pwm_irq_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/rom_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/rtc_irq_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// The single-cycle I/O block controls our GPIO pins
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/spi_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// Setup the pins.
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz());
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/uart_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz());
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/vector_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

// Create simple delay
Expand Down
1 change: 0 additions & 1 deletion rp2040-hal/examples/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fn main() -> ! {
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();

let mut delay = cortex_m::delay::Delay::new(core.SYST, clocks.system_clock.freq().to_Hz());
Expand Down
3 changes: 3 additions & 0 deletions rp2040-hal/src/clocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ impl ShareableClocks {
/// Something when wrong setting up the clock
#[non_exhaustive]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum ClockError {
/// The frequency desired is higher than the source frequency
CantIncreaseFreq,
Expand Down Expand Up @@ -488,6 +489,8 @@ impl ClocksManager {
}

/// Possible init errors
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub enum InitError {
/// Something went wrong setting up the Xosc
XoscErr(XoscError),
Expand Down
Loading