Skip to content

Commit d5aa4f6

Browse files
committed
format
1 parent a636eae commit d5aa4f6

File tree

9 files changed

+37
-33
lines changed

9 files changed

+37
-33
lines changed

hepa-uv/core/tasks.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ void hepauv_tasks::start_tasks(
3434
can_task::start_reader(can_bus);
3535

3636
// TODO: including led_hardware for testing, this should be a AssesorClient
37-
auto& hepa_task = hepa_task_builder.start(5, "hepa_fan", gpio_drive_pins, led_hardware);
38-
auto& uv_task = uv_task_builder.start(5, "uv_ballast", gpio_drive_pins, led_hardware);
39-
auto& led_control_task = led_control_task_builder.start(5, "push_button_leds", led_hardware);
37+
auto& hepa_task =
38+
hepa_task_builder.start(5, "hepa_fan", gpio_drive_pins, led_hardware);
39+
auto& uv_task =
40+
uv_task_builder.start(5, "uv_ballast", gpio_drive_pins, led_hardware);
41+
auto& led_control_task =
42+
led_control_task_builder.start(5, "push_button_leds", led_hardware);
4043

4144
tasks.hepa_task_handler = &hepa_task;
4245
tasks.uv_task_handler = &uv_task;
@@ -61,7 +64,8 @@ void hepauv_tasks::QueueClient::send_uv_message(const uv_task::TaskMessage& m) {
6164
uv_queue->try_write(m);
6265
}
6366

64-
void hepauv_tasks::QueueClient::send_led_control_message(const led_control_task::TaskMessage& m) {
67+
void hepauv_tasks::QueueClient::send_led_control_message(
68+
const led_control_task::TaskMessage& m) {
6569
led_control_queue->try_write(m);
6670
}
6771

hepa-uv/firmware/led_control_task/led_control_hardware.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
using namespace led_control_hardware;
77

88
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
9-
auto LEDControlHardware::initialize() -> void { button_led_hw_initialize_leds(); }
9+
auto LEDControlHardware::initialize() -> void {
10+
button_led_hw_initialize_leds();
11+
}
1012

11-
void LEDControlHardware::set_button_led_power(uint8_t button, uint32_t r, uint32_t g, uint32_t b, uint32_t w) {
13+
void LEDControlHardware::set_button_led_power(uint8_t button, uint32_t r,
14+
uint32_t g, uint32_t b,
15+
uint32_t w) {
1216
set_button_led_pwm(static_cast<PUSH_BUTTON_TYPE>(button), r, g, b, w);
1317
}

hepa-uv/firmware/main_rev1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#include "common/firmware/utility_gpio.h"
2323
#include "hepa-uv/core/messages.hpp"
2424
#include "hepa-uv/core/tasks.hpp"
25-
#include "hepa-uv/firmware/utility_gpio.h"
26-
#include "hepa-uv/firmware/led_hardware.h"
2725
#include "hepa-uv/firmware/led_control_hardware.hpp"
26+
#include "hepa-uv/firmware/led_hardware.h"
27+
#include "hepa-uv/firmware/utility_gpio.h"
2828

2929
static auto iWatchdog = iwdg::IndependentWatchDog{};
3030

include/hepa-uv/core/hepa_task.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#include "common/core/logging.h"
66
#include "common/core/message_queue.hpp"
77
#include "common/firmware/gpio.hpp"
8+
#include "hepa-uv/core/constants.h"
89
#include "hepa-uv/core/messages.hpp"
910
#include "hepa-uv/firmware/gpio_drive_hardware.hpp"
1011
#include "hepa-uv/firmware/led_control_hardware.hpp"
11-
#include "hepa-uv/core/constants.h"
1212

1313
namespace hepa_task {
1414

@@ -18,8 +18,7 @@ class HepaMessageHandler {
1818
public:
1919
explicit HepaMessageHandler(
2020
gpio_drive_hardware::GpioDrivePins &drive_pins,
21-
led_control_hardware::LEDControlHardware &led_hardware
22-
)
21+
led_control_hardware::LEDControlHardware &led_hardware)
2322
: drive_pins{drive_pins}, led_hardware{led_hardware} {
2423
// get current state
2524
hepa_push_button = gpio::is_set(drive_pins.hepa_push_button);

include/hepa-uv/core/led_control_task.hpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class LEDControlInterface {
1616
LEDControlInterface(const LEDControlInterface&) = delete;
1717
LEDControlInterface(LEDControlInterface&&) = delete;
1818
auto operator=(LEDControlInterface&&) -> LEDControlInterface& = delete;
19-
auto operator=(const LEDControlInterface&)
20-
-> LEDControlInterface& = delete;
19+
auto operator=(const LEDControlInterface&) -> LEDControlInterface& = delete;
2120
virtual ~LEDControlInterface() = default;
2221

23-
virtual auto set_button_led_power(uint8_t button, uint32_t r, uint32_t g, uint32_t b, uint32_t w) -> void = 0;
22+
virtual auto set_button_led_power(uint8_t button, uint32_t r, uint32_t g,
23+
uint32_t b, uint32_t w) -> void = 0;
2424
};
2525

2626
class LEDControlMessageHandler {
@@ -36,14 +36,11 @@ class LEDControlMessageHandler {
3636
auto handle(std::monostate&) -> void {}
3737

3838
auto handle(const led_control_task_messages::PushButtonLED& msg) -> void {
39-
// Sets the Push button LED colors
40-
_hardware.set_button_led_power(
41-
msg.button,
42-
static_cast<uint32_t>(msg.r),
43-
static_cast<uint32_t>(msg.g),
44-
static_cast<uint32_t>(msg.b),
45-
static_cast<uint32_t>(msg.w)
46-
);
39+
// Sets the Push button LED colors
40+
_hardware.set_button_led_power(msg.button, static_cast<uint32_t>(msg.r),
41+
static_cast<uint32_t>(msg.g),
42+
static_cast<uint32_t>(msg.b),
43+
static_cast<uint32_t>(msg.w));
4744
}
4845

4946
LEDControlInterface& _hardware;
@@ -69,8 +66,7 @@ class LEDControlTask {
6966
* Task entry point.
7067
*/
7168
[[noreturn]] void operator()(LEDControlInterface* hardware_handle) {
72-
auto handler =
73-
LEDControlMessageHandler(*hardware_handle);
69+
auto handler = LEDControlMessageHandler(*hardware_handle);
7470
TaskMessage message{};
7571

7672
for (;;) {

include/hepa-uv/core/messages.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace led_control_task_messages {
2424
* A message to change the leds on the push buttons
2525
*/
2626
struct PushButtonLED {
27-
PUSH_BUTTON_TYPE button;
27+
PUSH_BUTTON_TYPE button;
2828
double r = 0, g = 0, b = 0, w = 0;
2929
};
3030

include/hepa-uv/core/tasks.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
#include "can/core/message_writer.hpp"
33
#include "common/core/freertos_timer.hpp"
44
#include "hepa-uv/core/hepa_task.hpp"
5-
#include "hepa-uv/core/uv_task.hpp"
65
#include "hepa-uv/core/led_control_task.hpp"
7-
#include "hepa-uv/firmware/led_control_hardware.hpp"
6+
#include "hepa-uv/core/uv_task.hpp"
87
#include "hepa-uv/firmware/gpio_drive_hardware.hpp"
8+
#include "hepa-uv/firmware/led_control_hardware.hpp"
99

1010
namespace hepauv_tasks {
1111

@@ -49,8 +49,9 @@ struct AllTask {
4949
uv_task::UVTask<freertos_message_queue::FreeRTOSMessageQueue>*
5050
uv_task_handler{nullptr};
5151

52-
led_control_task::LEDControlTask<freertos_message_queue::FreeRTOSMessageQueue>*
53-
led_control_task_handler{nullptr};
52+
led_control_task::LEDControlTask<
53+
freertos_message_queue::FreeRTOSMessageQueue>* led_control_task_handler{
54+
nullptr};
5455
};
5556

5657
/**

include/hepa-uv/core/uv_task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UVMessageHandler {
2323
gpio_drive_hardware::GpioDrivePins &drive_pins,
2424
led_control_hardware::LEDControlHardware &led_hardware)
2525
: drive_pins{drive_pins},
26-
led_hardware{led_hardware},
26+
led_hardware{led_hardware},
2727
_timer(
2828
"UVTask", [ThisPtr = this] { ThisPtr->timer_callback(); },
2929
DELAY_MS) {

include/hepa-uv/firmware/led_control_hardware.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ class LEDControlHardware : public led_control_task::LEDControlInterface {
1010
LEDControlHardware(const LEDControlHardware&) = delete;
1111
LEDControlHardware(LEDControlHardware&&) = delete;
1212
auto operator=(LEDControlHardware&&) -> LEDControlHardware& = delete;
13-
auto operator=(const LEDControlHardware&)
14-
-> LEDControlHardware& = delete;
13+
auto operator=(const LEDControlHardware&) -> LEDControlHardware& = delete;
1514
~LEDControlHardware() final = default;
1615

1716
auto initialize() -> void;
18-
void set_button_led_power(uint8_t button, uint32_t r, uint32_t g, uint32_t b, uint32_t w) final;
17+
void set_button_led_power(uint8_t button, uint32_t r, uint32_t g,
18+
uint32_t b, uint32_t w) final;
1919
};
2020

2121
} // namespace led_control_hardware

0 commit comments

Comments
 (0)