From 7da16a726fdd121911605bd0ab4d383d7b137cd8 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Sun, 26 Dec 2021 19:29:14 +0000 Subject: [PATCH] Fixing typos spotted in the review. --- boards/adafruit-feather-rp2040/src/lib.rs | 4 ++-- boards/adafruit-itsy-bitsy-rp2040/src/lib.rs | 4 ++-- .../examples/adafruit_kb2040_rainbow.rs | 2 +- boards/adafruit-macropad/src/lib.rs | 4 ++-- boards/adafruit-qt-py-rp2040/src/lib.rs | 4 ++-- boards/pimoroni-pico-explorer/src/lib.rs | 4 ++-- boards/pimoroni-pico-lipo-16mb/src/lib.rs | 4 ++-- boards/rp-pico/examples/pico_i2c_pio.rs | 2 +- .../rp-pico/examples/pico_uart_irq_buffer.rs | 20 +++++++++---------- boards/rp-pico/examples/pico_uart_irq_echo.rs | 13 ++++++------ boards/rp-pico/src/lib.rs | 4 ++-- boards/sparkfun-pro-micro-rp2040/src/lib.rs | 4 ++-- rp2040-hal/examples/blinky.rs | 2 +- rp2040-hal/examples/multicore_fifo_blink.rs | 2 +- rp2040-hal/examples/pwm_blink.rs | 4 ++-- rp2040-hal/examples/rom_funcs.rs | 8 ++++---- rp2040-hal/examples/uart.rs | 6 +++--- rp2040-hal/examples/watchdog.rs | 2 +- 18 files changed, 46 insertions(+), 47 deletions(-) diff --git a/boards/adafruit-feather-rp2040/src/lib.rs b/boards/adafruit-feather-rp2040/src/lib.rs index 379346f..a8f1229 100644 --- a/boards/adafruit-feather-rp2040/src/lib.rs +++ b/boards/adafruit-feather-rp2040/src/lib.rs @@ -7,8 +7,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/adafruit-itsy-bitsy-rp2040/src/lib.rs b/boards/adafruit-itsy-bitsy-rp2040/src/lib.rs index e7c52e3..1a3394f 100644 --- a/boards/adafruit-itsy-bitsy-rp2040/src/lib.rs +++ b/boards/adafruit-itsy-bitsy-rp2040/src/lib.rs @@ -7,8 +7,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs b/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs index d64dc39..11a1181 100644 --- a/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs +++ b/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs @@ -28,7 +28,7 @@ use adafruit_kb2040::{ use smart_leds::{brightness, SmartLedsWrite, RGB8}; use ws2812_pio::Ws2812; -//// The linker will place this boot block at the start of our program image. +/// The linker will place this boot block at the start of our program image. /// We need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] diff --git a/boards/adafruit-macropad/src/lib.rs b/boards/adafruit-macropad/src/lib.rs index c3b1cfe..d197432 100644 --- a/boards/adafruit-macropad/src/lib.rs +++ b/boards/adafruit-macropad/src/lib.rs @@ -9,8 +9,8 @@ pub use cortex_m_rt::entry; // Adafruit macropad uses W25Q64JVxQ flash chip. Should work with BOOT_LOADER_W25Q080 (untested) -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/adafruit-qt-py-rp2040/src/lib.rs b/boards/adafruit-qt-py-rp2040/src/lib.rs index c32c2bd..d576614 100644 --- a/boards/adafruit-qt-py-rp2040/src/lib.rs +++ b/boards/adafruit-qt-py-rp2040/src/lib.rs @@ -7,8 +7,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/pimoroni-pico-explorer/src/lib.rs b/boards/pimoroni-pico-explorer/src/lib.rs index 5e1547f..f9ab626 100644 --- a/boards/pimoroni-pico-explorer/src/lib.rs +++ b/boards/pimoroni-pico-explorer/src/lib.rs @@ -8,8 +8,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/pimoroni-pico-lipo-16mb/src/lib.rs b/boards/pimoroni-pico-lipo-16mb/src/lib.rs index ebe0952..54b6d73 100644 --- a/boards/pimoroni-pico-lipo-16mb/src/lib.rs +++ b/boards/pimoroni-pico-lipo-16mb/src/lib.rs @@ -7,8 +7,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/rp-pico/examples/pico_i2c_pio.rs b/boards/rp-pico/examples/pico_i2c_pio.rs index b6cb1d0..7552e7a 100644 --- a/boards/rp-pico/examples/pico_i2c_pio.rs +++ b/boards/rp-pico/examples/pico_i2c_pio.rs @@ -91,7 +91,7 @@ fn main() -> ! { let uart_pins = ( // UART TX (characters sent from RP2040) on pin 1 (GPIO0) pins.gpio0.into_mode::(), - // UART RX (characters reveived by RP2040) on pin 2 (GPIO1) + // UART RX (characters received by RP2040) on pin 2 (GPIO1) pins.gpio1.into_mode::(), ); diff --git a/boards/rp-pico/examples/pico_uart_irq_buffer.rs b/boards/rp-pico/examples/pico_uart_irq_buffer.rs index c8d2a52..f506f5c 100644 --- a/boards/rp-pico/examples/pico_uart_irq_buffer.rs +++ b/boards/rp-pico/examples/pico_uart_irq_buffer.rs @@ -1,4 +1,4 @@ -//! # UART IRQ TX BUffer Example +//! # UART IRQ TX Buffer Example //! //! This application demonstrates how to use the UART Driver to talk to a //! serial connection. In this example, the IRQ owns the UART and you cannot @@ -6,8 +6,7 @@ //! static queue, and have the queue contents transferred to the UART under //! interrupt. //! -//! It may need to be adapted to your particular board layout and/or pin -//! assignment. The pinouts assume you have a Raspberry Pi Pico or compatible: +//! The pinouts are: //! //! * GPIO 0 - UART TX (out of the RP2040) //! * GPIO 1 - UART RX (in to the RP2040) @@ -72,7 +71,7 @@ struct UartQueue { } /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; @@ -97,7 +96,7 @@ static UART_TX_QUEUE: UartQueue = UartQueue { /// as soon as all global variables are initialised. /// /// The function configures the RP2040 peripherals, then writes to the UART in -/// an inifinite loop. +/// an infinite loop. #[entry] fn main() -> ! { // Grab our singleton objects @@ -127,7 +126,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins to their default state - let pins = hal::gpio::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, @@ -137,7 +136,7 @@ fn main() -> ! { let uart_pins = ( // UART TX (characters sent from RP2040) on pin 1 (GPIO0) pins.gpio0.into_mode::(), - // UART RX (characters reveived by RP2040) on pin 2 (GPIO1) + // UART RX (characters received by RP2040) on pin 2 (GPIO1) pins.gpio1.into_mode::(), ); @@ -160,11 +159,11 @@ fn main() -> ! { }); // But we can blink an LED. - let mut led_pin = pins.gpio25.into_push_pull_output(); + let mut led_pin = pins.led.into_push_pull_output(); loop { // Light the LED whilst the main thread is in the transmit routine. It - // shouldn't be on very long, but it will be on whilst we get enough + // shouldn't be on very long, but it will be on until we get enough // data /out/ of the queue and over the UART for this remainder of // this string to fit. led_pin.set_high().unwrap(); @@ -178,7 +177,8 @@ fn main() -> ! { ) .unwrap(); led_pin.set_low().unwrap(); - // Wait for a second - the UART TX IRQ will transmit the remainder of our queue contents in the background. + // Wait for a second - the UART TX IRQ will transmit the remainder of + // our queue contents in the background. delay.delay_ms(1000); } } diff --git a/boards/rp-pico/examples/pico_uart_irq_echo.rs b/boards/rp-pico/examples/pico_uart_irq_echo.rs index c974696..de8757f 100644 --- a/boards/rp-pico/examples/pico_uart_irq_echo.rs +++ b/boards/rp-pico/examples/pico_uart_irq_echo.rs @@ -4,8 +4,7 @@ //! connection. In this example, the IRQ owns the UART and you cannot do any UART //! access from the main thread. //! -//! It may need to be adapted to your particular board layout and/or pin -//! assignment. The pinouts assume you have a Raspberry Pi Pico or compatible: +//! The pinouts are: //! //! * GPIO 0 - UART TX (out of the RP2040) //! * GPIO 1 - UART RX (in to the RP2040) @@ -63,7 +62,7 @@ type UartPins = ( type Uart = hal::uart::UartPeripheral; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; @@ -81,7 +80,7 @@ static GLOBAL_UART: Mutex>> = Mutex::new(RefCell::new(None) /// as soon as all global variables are initialised. /// /// The function configures the RP2040 peripherals, then writes to the UART in -/// an inifinite loop. +/// an infinite loop. #[entry] fn main() -> ! { // Grab our singleton objects @@ -111,7 +110,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins to their default state - let pins = hal::gpio::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, @@ -121,7 +120,7 @@ fn main() -> ! { let uart_pins = ( // UART TX (characters sent from RP2040) on pin 1 (GPIO0) pins.gpio0.into_mode::(), - // UART RX (characters reveived by RP2040) on pin 2 (GPIO1) + // UART RX (characters received by RP2040) on pin 2 (GPIO1) pins.gpio1.into_mode::(), ); @@ -154,7 +153,7 @@ fn main() -> ! { }); // But we can blink an LED. - let mut led_pin = pins.gpio25.into_push_pull_output(); + let mut led_pin = pins.led.into_push_pull_output(); loop { // The normal *Wait For Interrupts* (WFI) has a race-hazard - the diff --git a/boards/rp-pico/src/lib.rs b/boards/rp-pico/src/lib.rs index 49f9946..7510ce2 100644 --- a/boards/rp-pico/src/lib.rs +++ b/boards/rp-pico/src/lib.rs @@ -7,8 +7,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/boards/sparkfun-pro-micro-rp2040/src/lib.rs b/boards/sparkfun-pro-micro-rp2040/src/lib.rs index 5370630..e4039b0 100644 --- a/boards/sparkfun-pro-micro-rp2040/src/lib.rs +++ b/boards/sparkfun-pro-micro-rp2040/src/lib.rs @@ -6,8 +6,8 @@ extern crate cortex_m_rt; #[cfg(feature = "rt")] pub use cortex_m_rt::entry; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[cfg(feature = "boot2")] #[link_section = ".boot2"] #[no_mangle] diff --git a/rp2040-hal/examples/blinky.rs b/rp2040-hal/examples/blinky.rs index 7bb0b5c..a9587b8 100644 --- a/rp2040-hal/examples/blinky.rs +++ b/rp2040-hal/examples/blinky.rs @@ -29,7 +29,7 @@ use embedded_time::fixed_point::FixedPoint; use rp2040_hal::clocks::Clock; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; diff --git a/rp2040-hal/examples/multicore_fifo_blink.rs b/rp2040-hal/examples/multicore_fifo_blink.rs index c0ca448..7b305a9 100644 --- a/rp2040-hal/examples/multicore_fifo_blink.rs +++ b/rp2040-hal/examples/multicore_fifo_blink.rs @@ -34,7 +34,7 @@ use hal::pac; use embedded_hal::digital::v2::ToggleableOutputPin; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; diff --git a/rp2040-hal/examples/pwm_blink.rs b/rp2040-hal/examples/pwm_blink.rs index 11f618a..064d999 100644 --- a/rp2040-hal/examples/pwm_blink.rs +++ b/rp2040-hal/examples/pwm_blink.rs @@ -29,8 +29,8 @@ use rp2040_hal::clocks::Clock; // register access use hal::pac; -//// The linker will place this boot block at the start of our program image. We -//// need this to help the ROM bootloader get our code up and running. +/// The linker will place this boot block at the start of our program image. We +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; diff --git a/rp2040-hal/examples/rom_funcs.rs b/rp2040-hal/examples/rom_funcs.rs index e4a349a..0d38233 100644 --- a/rp2040-hal/examples/rom_funcs.rs +++ b/rp2040-hal/examples/rom_funcs.rs @@ -27,7 +27,7 @@ use hal::pac; use core::fmt::Write; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; @@ -46,7 +46,7 @@ const SYSTICK_RELOAD: u32 = 0x00FF_FFFF; /// as soon as all global variables are initialised. /// /// The function configures the RP2040 peripherals, then writes to the UART in -/// an inifinite loop. +/// an infinite loop. #[entry] fn main() -> ! { // Grab our singleton objects @@ -83,7 +83,7 @@ fn main() -> ! { let uart_pins = ( // UART TX (characters sent from RP2040) on pin 1 (GPIO0) pins.gpio0.into_mode::(), - // UART RX (characters reveived by RP2040) on pin 2 (GPIO1) + // UART RX (characters received by RP2040) on pin 2 (GPIO1) pins.gpio1.into_mode::(), ); let mut uart = hal::uart::UartPeripheral::new(pac.UART0, uart_pins, &mut pac.RESETS) @@ -177,7 +177,7 @@ fn main() -> ! { /// ``` /// assert_eq!(1, calc_delta(SYSTICK_RELOAD, SYSTICK_RELOAD - 1)); /// assert_eq!(2, calc_delta(0, SYSTICK_RELOAD - 1)); -//// ``` +/// ``` fn calc_delta(start: u32, end: u32) -> u32 { if start < end { (start.wrapping_sub(end)) & SYSTICK_RELOAD diff --git a/rp2040-hal/examples/uart.rs b/rp2040-hal/examples/uart.rs index c4e122e..73ee783 100644 --- a/rp2040-hal/examples/uart.rs +++ b/rp2040-hal/examples/uart.rs @@ -31,7 +31,7 @@ use embedded_time::fixed_point::FixedPoint; use rp2040_hal::clocks::Clock; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080; @@ -46,7 +46,7 @@ const XTAL_FREQ_HZ: u32 = 12_000_000u32; /// as soon as all global variables are initialised. /// /// The function configures the RP2040 peripherals, then writes to the UART in -/// an inifinite loop. +/// an infinite loop. #[entry] fn main() -> ! { // Grab our singleton objects @@ -85,7 +85,7 @@ fn main() -> ! { let uart_pins = ( // UART TX (characters sent from RP2040) on pin 1 (GPIO0) pins.gpio0.into_mode::(), - // UART RX (characters reveived by RP2040) on pin 2 (GPIO1) + // UART RX (characters received by RP2040) on pin 2 (GPIO1) pins.gpio1.into_mode::(), ); let mut uart = hal::uart::UartPeripheral::new(pac.UART0, uart_pins, &mut pac.RESETS) diff --git a/rp2040-hal/examples/watchdog.rs b/rp2040-hal/examples/watchdog.rs index e7ec88e..f72ba56 100644 --- a/rp2040-hal/examples/watchdog.rs +++ b/rp2040-hal/examples/watchdog.rs @@ -31,7 +31,7 @@ use embedded_time::fixed_point::FixedPoint; use rp2040_hal::clocks::Clock; /// The linker will place this boot block at the start of our program image. We -// need this to help the ROM bootloader get our code up and running. +/// need this to help the ROM bootloader get our code up and running. #[link_section = ".boot2"] #[used] pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_W25Q080;