From 5a06d242c4c0864d6522516b72aeafb3ce504f59 Mon Sep 17 00:00:00 2001 From: Martins Polakovs Date: Sun, 17 Mar 2024 11:40:31 +0200 Subject: [PATCH] Use timer variable name --- .../examples/adafruit_feather_neopixel_rainbow.rs | 4 ++-- .../examples/adafruit_itsy_bitsy_rainbow.rs | 4 ++-- boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs | 4 ++-- .../adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs | 4 ++-- .../examples/adafruit_qt_py_rp2040_rainbow.rs | 4 ++-- .../examples/adafruit_trinkey_qt2040_rainbow.rs | 4 ++-- boards/boardsource-blok/examples/blok_rainbow.rs | 4 ++-- .../pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs | 4 ++-- .../examples/solderparty_stamp_neopixel_rainbow.rs | 4 ++-- .../examples/sparkfun_pro_micro_rainbow.rs | 4 ++-- .../examples/sparkfun_thing_plus_rainbow.rs | 4 ++-- .../vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs | 4 ++-- .../examples/waveshare_rp2040_zero_neopixel_rainbow.rs | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/boards/adafruit-feather-rp2040/examples/adafruit_feather_neopixel_rainbow.rs b/boards/adafruit-feather-rp2040/examples/adafruit_feather_neopixel_rainbow.rs index 1965655..5139d78 100644 --- a/boards/adafruit-feather-rp2040/examples/adafruit_feather_neopixel_rainbow.rs +++ b/boards/adafruit-feather-rp2040/examples/adafruit_feather_neopixel_rainbow.rs @@ -51,7 +51,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -66,11 +65,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs b/boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs index 0400367..2e8d17c 100644 --- a/boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs +++ b/boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs @@ -53,7 +53,6 @@ fn main() -> ! { .into_push_pull_output_in_state(PinState::High); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); let mut ws = Ws2812::new( @@ -65,11 +64,12 @@ fn main() -> ! { ); let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs b/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs index 2ac33f8..b96ae46 100644 --- a/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs +++ b/boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs @@ -63,7 +63,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -79,11 +78,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs b/boards/adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs index d228667..3e874af 100644 --- a/boards/adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs +++ b/boards/adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs @@ -49,7 +49,6 @@ fn main() -> ! { let led = pins.neopixel_data.into_function(); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); let mut ws = Ws2812::new( @@ -61,11 +60,12 @@ fn main() -> ! { ); let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/adafruit-qt-py-rp2040/examples/adafruit_qt_py_rp2040_rainbow.rs b/boards/adafruit-qt-py-rp2040/examples/adafruit_qt_py_rp2040_rainbow.rs index f246ce4..3953474 100644 --- a/boards/adafruit-qt-py-rp2040/examples/adafruit_qt_py_rp2040_rainbow.rs +++ b/boards/adafruit-qt-py-rp2040/examples/adafruit_qt_py_rp2040_rainbow.rs @@ -53,7 +53,6 @@ fn main() -> ! { .into_push_pull_output_in_state(PinState::High); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); let mut ws = Ws2812::new( @@ -65,11 +64,12 @@ fn main() -> ! { ); let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/adafruit-trinkey-qt2040/examples/adafruit_trinkey_qt2040_rainbow.rs b/boards/adafruit-trinkey-qt2040/examples/adafruit_trinkey_qt2040_rainbow.rs index 185a4d5..54c1403 100644 --- a/boards/adafruit-trinkey-qt2040/examples/adafruit_trinkey_qt2040_rainbow.rs +++ b/boards/adafruit-trinkey-qt2040/examples/adafruit_trinkey_qt2040_rainbow.rs @@ -63,7 +63,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -79,11 +78,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/boardsource-blok/examples/blok_rainbow.rs b/boards/boardsource-blok/examples/blok_rainbow.rs index 4dd157b..fb6dc35 100644 --- a/boards/boardsource-blok/examples/blok_rainbow.rs +++ b/boards/boardsource-blok/examples/blok_rainbow.rs @@ -54,7 +54,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -69,11 +68,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs b/boards/pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs index 24d6fdf..9e34048 100644 --- a/boards/pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs +++ b/boards/pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs @@ -47,7 +47,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -63,6 +62,7 @@ fn main() -> ! { // Infinite color wheel loop let mut n: u8 = 128; + let mut timer = timer; let offset = (256u16 / bsp::NUM_LEDS as u16) as u8; loop { ws.write(brightness( @@ -79,7 +79,7 @@ fn main() -> ! { .unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/solderparty-rp2040-stamp/examples/solderparty_stamp_neopixel_rainbow.rs b/boards/solderparty-rp2040-stamp/examples/solderparty_stamp_neopixel_rainbow.rs index 66bb717..7da52b6 100644 --- a/boards/solderparty-rp2040-stamp/examples/solderparty_stamp_neopixel_rainbow.rs +++ b/boards/solderparty-rp2040-stamp/examples/solderparty_stamp_neopixel_rainbow.rs @@ -51,7 +51,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -66,11 +65,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/sparkfun-pro-micro-rp2040/examples/sparkfun_pro_micro_rainbow.rs b/boards/sparkfun-pro-micro-rp2040/examples/sparkfun_pro_micro_rainbow.rs index 11c2545..75cbb57 100644 --- a/boards/sparkfun-pro-micro-rp2040/examples/sparkfun_pro_micro_rainbow.rs +++ b/boards/sparkfun-pro-micro-rp2040/examples/sparkfun_pro_micro_rainbow.rs @@ -63,7 +63,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -78,11 +77,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/sparkfun-thing-plus-rp2040/examples/sparkfun_thing_plus_rainbow.rs b/boards/sparkfun-thing-plus-rp2040/examples/sparkfun_thing_plus_rainbow.rs index 91776e9..5a5f18c 100644 --- a/boards/sparkfun-thing-plus-rp2040/examples/sparkfun_thing_plus_rainbow.rs +++ b/boards/sparkfun-thing-plus-rp2040/examples/sparkfun_thing_plus_rainbow.rs @@ -62,7 +62,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -77,11 +76,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs b/boards/vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs index edf2ddd..6254d86 100644 --- a/boards/vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs +++ b/boards/vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs @@ -51,7 +51,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -66,11 +65,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } } diff --git a/boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs b/boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs index b3acc29..a90294c 100644 --- a/boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs +++ b/boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs @@ -51,7 +51,6 @@ fn main() -> ! { ); let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks); - let mut delay = timer; // Configure the addressable LED let (mut pio, sm0, _, _, _) = pac.PIO0.split(&mut pac.RESETS); @@ -66,11 +65,12 @@ fn main() -> ! { // Infinite colour wheel loop let mut n: u8 = 128; + let mut timer = timer; loop { ws.write(brightness(once(wheel(n)), 32)).unwrap(); n = n.wrapping_add(1); - delay.delay_ms(25); + timer.delay_ms(25); } }