From 24bd27ad7f9d8c09ab0961c5045c377317ed6f1d Mon Sep 17 00:00:00 2001 From: chrysn Date: Sun, 25 Aug 2024 02:17:50 +0200 Subject: [PATCH] tests: Follow renaming deprecation --- tests/led/src/lib.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/led/src/lib.rs b/tests/led/src/lib.rs index 6d1b906..792d50a 100644 --- a/tests/led/src/lib.rs +++ b/tests/led/src/lib.rs @@ -6,14 +6,17 @@ use riot_wrappers::riot_main; riot_main!(main); fn main() { - let mut led0 = LED::<0>::new(); - let mut led1 = LED::<1>::new(); - let mut led2 = LED::<2>::new(); - let mut led3 = LED::<3>::new(); - let mut led4 = LED::<4>::new(); - let mut led5 = LED::<5>::new(); - let mut led6 = LED::<6>::new(); - let mut led7 = LED::<7>::new(); + // Using the `unchecked` methods because the loop rotates the blinking speeds through all LEDs + // anyway -- so every speed will be on every LED, and that's easier to express if the number of + // considered LEDs is constant. + let mut led0 = LED::<0>::new_unchecked(); + let mut led1 = LED::<1>::new_unchecked(); + let mut led2 = LED::<2>::new_unchecked(); + let mut led3 = LED::<3>::new_unchecked(); + let mut led4 = LED::<4>::new_unchecked(); + let mut led5 = LED::<5>::new_unchecked(); + let mut led6 = LED::<6>::new_unchecked(); + let mut led7 = LED::<7>::new_unchecked(); let mut leds: [&mut dyn switch_hal::ToggleableOutputSwitch; 8] = [ &mut led0, &mut led1, &mut led2, &mut led3, &mut led4, &mut led5, &mut led6, &mut led7, ];