From 7fef19d2fb91e0f3544c89441e6af131cdc90c6a Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sat, 6 Apr 2019 12:01:49 +0200 Subject: [PATCH] Rename the set_directions method on LedRing This hopefully prevens confusion between "compass directions" and LED ring cycle direction. --- src/led_ring.rs | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/led_ring.rs b/src/led_ring.rs index 038d81f..4893546 100644 --- a/src/led_ring.rs +++ b/src/led_ring.rs @@ -135,11 +135,11 @@ impl LedRing { } } - /// Turns on specific LEDs based on the direction array. + /// Turns on specific LEDs based on the "direction" array. /// /// When looking with the mini-USB port of the board held down (south), the directions of /// the array can be interpreted as: `[east, south, west, north]`. - pub fn set_directions(&mut self, directions: [bool; 4]) { + pub fn specific_on(&mut self, directions: [bool; 4]) { for (led, on_off) in self.leds.iter_mut().zip(directions.iter()) { if *on_off { led.set_high(); diff --git a/src/main.rs b/src/main.rs index cf8cfb7..4d6e26e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -151,7 +151,7 @@ const APP: () = { resources.led_ring.lock(|led_ring| { if led_ring.is_mode_accel() { let directions = [acc_y < 0, acc_x < 0, acc_y > 0, acc_x > 0]; - led_ring.set_directions(directions); + led_ring.specific_on(directions); schedule .accel_leds(scheduled + LedRing::PERIOD.cycles()) .unwrap();