Skip to content

Commit

Permalink
Use timer variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsp committed Mar 17, 2024
1 parent 0a681ab commit 5a06d24
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions boards/adafruit-kb2040/examples/adafruit_kb2040_rainbow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions boards/boardsource-blok/examples/blok_rainbow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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(
Expand All @@ -79,7 +79,7 @@ fn main() -> ! {
.unwrap();
n = n.wrapping_add(1);

delay.delay_ms(25);
timer.delay_ms(25);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 5a06d24

Please sign in to comment.