From d251627e4784448414d111980e198f58ccc5a5fe Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (42 Technology)" <jonathan.pallant@42technology.com> Date: Mon, 27 Sep 2021 19:01:46 +0100 Subject: [PATCH] Make trait comments more consistent. --- rp2040-hal/examples/adc.rs | 2 +- rp2040-hal/examples/blinky.rs | 2 +- rp2040-hal/examples/gpio_in_out.rs | 2 +- rp2040-hal/examples/i2c.rs | 4 +--- rp2040-hal/examples/lcd_display.rs | 4 +++- rp2040-hal/examples/spi.rs | 8 ++++++-- rp2040-hal/examples/uart.rs | 2 ++ rp2040-hal/examples/watchdog.rs | 7 +++++-- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/rp2040-hal/examples/adc.rs b/rp2040-hal/examples/adc.rs index 53f3257..88809d1 100644 --- a/rp2040-hal/examples/adc.rs +++ b/rp2040-hal/examples/adc.rs @@ -20,7 +20,7 @@ use panic_halt as _; // Alias for our HAL crate use rp2040_hal as hal; -// The traits we need +// Some traits we need use core::fmt::Write; use embedded_hal::adc::OneShot; use embedded_time::fixed_point::FixedPoint; diff --git a/rp2040-hal/examples/blinky.rs b/rp2040-hal/examples/blinky.rs index a11020e..6cf2f43 100644 --- a/rp2040-hal/examples/blinky.rs +++ b/rp2040-hal/examples/blinky.rs @@ -23,7 +23,7 @@ use rp2040_hal as hal; // register access use hal::pac; -// A GPIO trait we need +// Some traits we need use embedded_hal::digital::v2::OutputPin; use embedded_time::fixed_point::FixedPoint; use rp2040_hal::clocks::Clock; diff --git a/rp2040-hal/examples/gpio_in_out.rs b/rp2040-hal/examples/gpio_in_out.rs index 0b592d9..f2aa738 100644 --- a/rp2040-hal/examples/gpio_in_out.rs +++ b/rp2040-hal/examples/gpio_in_out.rs @@ -23,7 +23,7 @@ use rp2040_hal as hal; // register access use hal::pac; -// The traits we need +// Some traits we need use embedded_hal::digital::v2::InputPin; use embedded_hal::digital::v2::OutputPin; diff --git a/rp2040-hal/examples/i2c.rs b/rp2040-hal/examples/i2c.rs index f77bfc1..8d401fd 100644 --- a/rp2040-hal/examples/i2c.rs +++ b/rp2040-hal/examples/i2c.rs @@ -16,10 +16,8 @@ use cortex_m_rt::entry; // be linked) use panic_halt as _; -// The I²C trait from Embedded HAL we need +// Some traits we need use embedded_hal::blocking::i2c::Write; - -// A frequency/time related trait we need use embedded_time::rate::Extensions; // Alias for our HAL crate diff --git a/rp2040-hal/examples/lcd_display.rs b/rp2040-hal/examples/lcd_display.rs index 4447b24..bb9fe9c 100644 --- a/rp2040-hal/examples/lcd_display.rs +++ b/rp2040-hal/examples/lcd_display.rs @@ -25,7 +25,7 @@ use rp2040_hal as hal; // Our LCD driver use hd44780_driver as hd44780; -// Traits we need +// Some traits we need use embedded_time::fixed_point::FixedPoint; use rp2040_hal::clocks::Clock; @@ -118,3 +118,5 @@ fn main() -> ! { // Empty loop } } + +// End of file diff --git a/rp2040-hal/examples/spi.rs b/rp2040-hal/examples/spi.rs index 255a4df..35ba729 100644 --- a/rp2040-hal/examples/spi.rs +++ b/rp2040-hal/examples/spi.rs @@ -22,7 +22,7 @@ use panic_halt as _; // Alias for our HAL crate use rp2040_hal as hal; -// Traits we need +// Some traits we need use cortex_m::prelude::*; use embedded_time::rate::Extensions; use rp2040_hal::clocks::Clock; @@ -122,5 +122,9 @@ fn main() -> ! { }; #[allow(clippy::empty_loop)] - loop {} + loop { + // Empty loop + } } + +// End of file \ No newline at end of file diff --git a/rp2040-hal/examples/uart.rs b/rp2040-hal/examples/uart.rs index 16459e1..e20443e 100644 --- a/rp2040-hal/examples/uart.rs +++ b/rp2040-hal/examples/uart.rs @@ -104,3 +104,5 @@ fn main() -> ! { value += 1 } } + +// End of file diff --git a/rp2040-hal/examples/watchdog.rs b/rp2040-hal/examples/watchdog.rs index c901b97..79ef7d5 100644 --- a/rp2040-hal/examples/watchdog.rs +++ b/rp2040-hal/examples/watchdog.rs @@ -23,7 +23,7 @@ use rp2040_hal as hal; // register access use hal::pac; -// Traits we need +// Some traits we need use embedded_hal::digital::v2::OutputPin; use embedded_hal::watchdog::{Watchdog, WatchdogEnable}; use embedded_time::duration::Extensions; @@ -46,7 +46,8 @@ const XTAL_FREQ_HZ: u32 = 12_000_000u32; /// as soon as all global variables are initialised. /// /// The function configures the RP2040 peripherals, then toggles a GPIO pin in -/// an infinite loop. If there is an LED connected to that pin, it will blink. +/// an infinite loop. After a period of time, the watchdog will kick in to reset +/// the CPU. #[entry] fn main() -> ! { // Grab our singleton objects @@ -110,3 +111,5 @@ fn main() -> ! { delay.delay_ms(100); } } + +// End of file \ No newline at end of file