Skip to content

Commit

Permalink
fixed temperature setpoint initialization to std::nullopt (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg authored Jun 10, 2022
1 parent c9fc6b5 commit 8cd4186
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stm32-modules/heater-shaker/tests/test_heater_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ SCENARIO("heater task message passing") {
auto gettemp =
std::get<messages::GetTemperatureResponse>(response);
REQUIRE(gettemp.responding_to_id == message.id);
REQUIRE(gettemp.setpoint_temperature == 0);
REQUIRE(gettemp.setpoint_temperature == std::nullopt);
REQUIRE_THAT(gettemp.current_temperature,
Catch::Matchers::WithinAbs(55.0, .01));
}
Expand Down
2 changes: 1 addition & 1 deletion stm32-modules/heater-shaker/tests/test_message_passing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SCENARIO("testing full message passing integration") {
written = tasks->get_host_comms_task().run_once(
response_buffer.begin(), response_buffer.end());
REQUIRE_THAT(response_buffer, Catch::Matchers::StartsWith(
"M105 C:95.20 T:0.00 OK\n"));
"M105 C:95.20 T:None OK\n"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class HeaterTask {
.error_bit = State::BOARD_SENSE_ERROR},
state{.system_status = State::IDLE, .error_bitmap = 0},
pid(DEFAULT_KP, DEFAULT_KI, DEFAULT_KD, CONTROL_PERIOD_S, 1.0, -1.0),
setpoint(0),
setpoint(std::nullopt),
_flash(),
_offset_constants{.b = OFFSET_DEFAULT_CONST_B,
.c = OFFSET_DEFAULT_CONST_C} {}
Expand Down

0 comments on commit 8cd4186

Please sign in to comment.