Rename the set_directions method on LedRing
This hopefully prevens confusion between "compass directions" and LED ring cycle direction.
This commit is contained in:
parent
6aab250e73
commit
7fef19d2fb
|
@ -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
|
/// 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]`.
|
/// 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()) {
|
for (led, on_off) in self.leds.iter_mut().zip(directions.iter()) {
|
||||||
if *on_off {
|
if *on_off {
|
||||||
led.set_high();
|
led.set_high();
|
||||||
|
|
|
@ -151,7 +151,7 @@ const APP: () = {
|
||||||
resources.led_ring.lock(|led_ring| {
|
resources.led_ring.lock(|led_ring| {
|
||||||
if led_ring.is_mode_accel() {
|
if led_ring.is_mode_accel() {
|
||||||
let directions = [acc_y < 0, acc_x < 0, acc_y > 0, acc_x > 0];
|
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
|
schedule
|
||||||
.accel_leds(scheduled + LedRing::PERIOD.cycles())
|
.accel_leds(scheduled + LedRing::PERIOD.cycles())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
Loading…
Reference in New Issue