mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-12 21:31:31 +11:00
Fixing typos spotted in the review.
This commit is contained in:
parent
d3bd232885
commit
7da16a726f
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -91,7 +91,7 @@ fn main() -> ! {
|
|||
let uart_pins = (
|
||||
// UART TX (characters sent from RP2040) on pin 1 (GPIO0)
|
||||
pins.gpio0.into_mode::<hal::gpio::FunctionUart>(),
|
||||
// UART RX (characters reveived by RP2040) on pin 2 (GPIO1)
|
||||
// UART RX (characters received by RP2040) on pin 2 (GPIO1)
|
||||
pins.gpio1.into_mode::<hal::gpio::FunctionUart>(),
|
||||
);
|
||||
|
||||
|
|
|
@ -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::<hal::gpio::FunctionUart>(),
|
||||
// UART RX (characters reveived by RP2040) on pin 2 (GPIO1)
|
||||
// UART RX (characters received by RP2040) on pin 2 (GPIO1)
|
||||
pins.gpio1.into_mode::<hal::gpio::FunctionUart>(),
|
||||
);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<hal::uart::Enabled, pac::UART0, UartPins>;
|
||||
|
||||
/// 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<RefCell<Option<Uart>>> = 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::<hal::gpio::FunctionUart>(),
|
||||
// UART RX (characters reveived by RP2040) on pin 2 (GPIO1)
|
||||
// UART RX (characters received by RP2040) on pin 2 (GPIO1)
|
||||
pins.gpio1.into_mode::<hal::gpio::FunctionUart>(),
|
||||
);
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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::<hal::gpio::FunctionUart>(),
|
||||
// UART RX (characters reveived by RP2040) on pin 2 (GPIO1)
|
||||
// UART RX (characters received by RP2040) on pin 2 (GPIO1)
|
||||
pins.gpio1.into_mode::<hal::gpio::FunctionUart>(),
|
||||
);
|
||||
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
|
||||
|
|
|
@ -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::<hal::gpio::FunctionUart>(),
|
||||
// UART RX (characters reveived by RP2040) on pin 2 (GPIO1)
|
||||
// UART RX (characters received by RP2040) on pin 2 (GPIO1)
|
||||
pins.gpio1.into_mode::<hal::gpio::FunctionUart>(),
|
||||
);
|
||||
let mut uart = hal::uart::UartPeripheral::new(pac.UART0, uart_pins, &mut pac.RESETS)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue