Skip to content

Commit cfc2e66

Browse files
committed
remove i2c dep from pump task
1 parent 068d724 commit cfc2e66

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

stm32-modules/include/vacuum-module/firmware/freertos_tasks.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ auto run(tasks::FirmwareTasks::QueueAggregator* aggregator,
3232

3333
namespace pump_control_task {
3434
// Actual function that runs in the task
35-
auto run(tasks::FirmwareTasks::QueueAggregator* aggregator,
36-
i2c::hardware::I2C* i2c_comms) -> void;
35+
auto run(tasks::FirmwareTasks::QueueAggregator* aggregator) -> void;
3736
} // namespace pump_control_task

stm32-modules/include/vacuum-module/vacuum-module/MPRLL0025PA00001A.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MPRLL0025PA00001 {
9898
// Calculation of pressure value according to equation 2 of datasheet
9999
// Equation 2: Pressure Output Function
100100
auto press_counts =
101-
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
101+
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
102102
(double)((int32_t)raw[3] + (int32_t)raw[2] * (int32_t)256 +
103103
(int32_t)raw[1] *
104104
(int32_t)65536); // calculate digital pressure counts

stm32-modules/include/vacuum-module/vacuum-module/lps22df.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class LPS222DF {
9494
// pressure in hPa, take the complete 24-bit word and then divide by the
9595
// sensitivity 4096 LSB/hPa.
9696
int32_t pressure_lsb =
97-
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
97+
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
9898
((int32_t)raw[3] << 16) | ((int32_t)raw[2] << 8) | (int32_t)raw[1];
9999

100100
// Convert from 24-bit twos complement to signed 32-bit

stm32-modules/vacuum-module/firmware/main.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ using EntryPointUI = std::function<void(tasks::FirmwareTasks::QueueAggregator *,
2525
using EntryPointPressure = std::function<void(
2626
tasks::FirmwareTasks::QueueAggregator *, i2c::hardware::I2C *,
2727
i2c::hardware::I2C *, i2c::hardware::I2C *)>;
28-
using EntryPointPump = std::function<void(
29-
tasks::FirmwareTasks::QueueAggregator *, i2c::hardware::I2C *)>;
28+
using EntryPointPump =
29+
std::function<void(tasks::FirmwareTasks::QueueAggregator *)>;
3030

3131
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
3232
static auto ui_task_entry = EntryPointUI(ui_control_task::run);
@@ -87,11 +87,9 @@ auto main() -> int {
8787
system_task.start(tasks::SYSTEM_TASK_PRIORITY, "System", &aggregator);
8888
host_comms_task.start(tasks::COMMS_TASK_PRIORITY, "Comms", &aggregator);
8989
ui_task.start(tasks::UI_TASK_PRIORITY, "UI", &aggregator, &i2c2_comms);
90+
pump_task.start(tasks::PUMP_TASK_PRIORITY, "Pump", &aggregator);
9091
pressure_task.start(tasks::PRESSURE_TASK_PRIORITY, "Pressure", &aggregator,
91-
// TODO: switch to i2c1
92-
&i2c2_comms, &i2c2_comms, &i2c3_comms);
93-
pump_task.start(tasks::PUMP_TASK_PRIORITY, "Pump", &aggregator,
94-
&i2c2_comms);
92+
&i2c1_comms, &i2c2_comms, &i2c3_comms);
9593

9694
vTaskStartScheduler();
9795
return 0;

stm32-modules/vacuum-module/firmware/pump_task/freertos_pump_task.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ static tasks::FirmwareTasks::PumpQueue
2222
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
2323
static auto _top_task = pump_task::PumpTask(_queue, nullptr, nullptr);
2424

25-
auto run(tasks::FirmwareTasks::QueueAggregator* aggregator,
26-
i2c::hardware::I2C* i2c1_comms) -> void {
25+
auto run(tasks::FirmwareTasks::QueueAggregator* aggregator) -> void {
2726
auto* handle = xTaskGetCurrentTaskHandle();
2827
_queue.provide_handle(handle);
2928
aggregator->register_queue(_queue);

0 commit comments

Comments
 (0)