Skip to content

Commit

Permalink
fix(hepa-uv): Set the UV pushbutton status led correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 committed Mar 19, 2024
1 parent b11fd3d commit f9c5e87
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions include/hepa-uv/core/uv_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,24 @@ class UVMessageHandler {
if (_timer.is_running()) {
gpio::reset(drive_pins.uv_on_off);
_timer.stop();
// send error message when door/reed state change while uv
// is on
auto resp = can::messages::ErrorMessage{
// send error message when door/reed state change while uv
// is on
auto resp = can::messages::ErrorMessage{
.message_index = 0,
.severity = can::ids::ErrorSeverity::unrecoverable,
.error_code = !door_closed ? can::ids::ErrorCode::door_open
: can::ids::ErrorCode::reed_open,
};
can_client.send_can_message(can::ids::NodeId::host, resp);
}
led_control_client.send_led_control_message(
// Set the push button LED's to user intervention (blue)
led_control_task_messages::PushButtonLED(UV_BUTTON, 0, 0, 50,
0));
// Set the push button LED's to user intervention (blue) when
// attempting to turn on the uv light while the door is opened or
// reed switch is not set.
if (light_on) {
led_control_client.send_led_control_message(
led_control_task_messages::PushButtonLED(UV_BUTTON, 0, 0,
50, 0));
}
uv_push_button = false;
uv_light_on = false;
return;
Expand Down

0 comments on commit f9c5e87

Please sign in to comment.