Add a water pattern and disable the brake sensor
This commit is contained in:
parent
019d9e7a6b
commit
911bc97b69
|
@ -119,6 +119,7 @@ impl<
|
||||||
> UI for BikeUI<D, P, LeftId, RightId, PreviousId, NextId, BrakeId>
|
> UI for BikeUI<D, P, LeftId, RightId, PreviousId, NextId, BrakeId>
|
||||||
{
|
{
|
||||||
fn check_event(&mut self, current_time: Instant) -> Option<Event> {
|
fn check_event(&mut self, current_time: Instant) -> Option<Event> {
|
||||||
|
/*
|
||||||
if self.brake_sensor.is_high().unwrap_or(true) && !self.brake_enabled {
|
if self.brake_sensor.is_high().unwrap_or(true) && !self.brake_enabled {
|
||||||
self.brake_enabled = true;
|
self.brake_enabled = true;
|
||||||
Some(Event::Brake)
|
Some(Event::Brake)
|
||||||
|
@ -126,6 +127,8 @@ impl<
|
||||||
self.brake_enabled = false;
|
self.brake_enabled = false;
|
||||||
Some(Event::BrakeRelease)
|
Some(Event::BrakeRelease)
|
||||||
} else if self.left_blinker_button.is_low(current_time) {
|
} else if self.left_blinker_button.is_low(current_time) {
|
||||||
|
*/
|
||||||
|
if self.left_blinker_button.is_low(current_time) {
|
||||||
self.left_blinker_button.set_debounce(current_time);
|
self.left_blinker_button.set_debounce(current_time);
|
||||||
Some(Event::LeftBlinker)
|
Some(Event::LeftBlinker)
|
||||||
} else if self.right_blinker_button.is_low(current_time) {
|
} else if self.right_blinker_button.is_low(current_time) {
|
||||||
|
|
|
@ -336,7 +336,7 @@ impl Pattern {
|
||||||
|
|
||||||
fn body(&self) -> BodyPattern {
|
fn body(&self) -> BodyPattern {
|
||||||
match self {
|
match self {
|
||||||
Pattern::Water => OFF_BODY,
|
Pattern::Water => WATER_BODY,
|
||||||
Pattern::GayPride => PRIDE_BODY,
|
Pattern::GayPride => PRIDE_BODY,
|
||||||
Pattern::TransPride => TRANS_PRIDE_BODY,
|
Pattern::TransPride => TRANS_PRIDE_BODY,
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,74 @@ pub const DEFAULT_FRAMES: U16F0 = U16F0::lit("30");
|
||||||
|
|
||||||
pub const WATER_DASHBOARD: DashboardPattern = [WATER_1, WATER_2, WATER_3];
|
pub const WATER_DASHBOARD: DashboardPattern = [WATER_1, WATER_2, WATER_3];
|
||||||
|
|
||||||
pub const WATER_BODY: BodyPattern = [RGB_OFF; 60];
|
pub const WATER_BODY: BodyPattern = [
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
|
||||||
|
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
WATER_3,
|
||||||
|
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
WATER_2,
|
||||||
|
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
WATER_1,
|
||||||
|
];
|
||||||
|
|
||||||
pub const PRIDE_DASHBOARD: DashboardPattern = [PRIDE_RED, PRIDE_GREEN, PRIDE_INDIGO];
|
pub const PRIDE_DASHBOARD: DashboardPattern = [PRIDE_RED, PRIDE_GREEN, PRIDE_INDIGO];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue