Skip to content

Commit 05e110c

Browse files
authored
Merge pull request #64 from joaommartins/feature/rp2040-zero-comments-fix
Fixes board name in comments, adds main() documentation
2 parents f44ea16 + 621e957 commit 05e110c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
//! Rainbow effect color wheel using the onboard NeoPixel on an Waveshare RP2040 Zero board
1+
//! Rainbow effect color wheel using the onboard NeoPixel on an Waveshare RP2040-Zero board
22
//!
3-
//! This flows smoothly through various colors on the onboard NeoPixel.
3+
//! This flows smoothly through various colours on the onboard NeoPixel.
44
//! Uses the `ws2812_pio` driver to control the NeoPixel, which in turns uses the
55
//! RP2040's PIO block.
66
#![no_std]
@@ -24,6 +24,13 @@ use waveshare_rp2040_zero::{
2424
};
2525
use ws2812_pio::Ws2812;
2626

27+
/// Entry point to our bare-metal application.
28+
///
29+
/// The `#[entry]` macro ensures the Cortex-M start-up code calls this function
30+
/// as soon as all global variables are initialised.
31+
///
32+
/// The function configures the RP2040 peripherals, then infinitely cycles the built-in LED colour from red, to green,
33+
/// to blue and back to red.
2734
#[entry]
2835
fn main() -> ! {
2936
let mut pac = pac::Peripherals::take().unwrap();
@@ -55,7 +62,7 @@ fn main() -> ! {
5562
// Configure the addressable LED
5663
let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS);
5764
let mut ws = Ws2812::new(
58-
// The onboard NeoPixel is attached to GPIO pin #16 on the Feather RP2040.
65+
// The onboard NeoPixel is attached to GPIO pin #16 on the Waveshare RP2040-Zero.
5966
pins.neopixel.into_function(),
6067
&mut pio,
6168
sm0,

0 commit comments

Comments
 (0)