Skip to content

Commit

Permalink
updated consts (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg authored Aug 3, 2022
1 parent 83232b8 commit 56961b6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions stm32-modules/heater-shaker/tests/test_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ TEST_CASE("blank flash reading") {
flash.get_offset_constants(tasks->get_heater_policy());
THEN("the resulting constants are defaults") {
REQUIRE_THAT(readback.b,
Catch::Matchers::WithinAbs(-0.021, 0.01));
Catch::Matchers::WithinAbs(-0.0259, 0.01));
REQUIRE_THAT(readback.c,
Catch::Matchers::WithinAbs(0.497, 0.01));
Catch::Matchers::WithinAbs(0.6755, 0.01));
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion stm32-modules/heater-shaker/tests/test_heater_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
#include "test/task_builder.hpp"

constexpr double _valid_temp = 55.0;
constexpr double _thermal_offset_B = -0.0259;
constexpr double _thermal_offset_C = 0.6755;
constexpr double _valid_temp_offset =
54.342; // with offsets of (B=-0.021, C=0.497)
(1 + _thermal_offset_B) * _valid_temp + _thermal_offset_C;

static auto _converter =
thermistor_conversion::Conversion<lookups::NTCG104ED104DTDSX>(
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 @@ -91,7 +91,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:93.70 T:None OK\n"));
"M105 C:93.41 T:None OK\n"));
}
}

Expand Down
4 changes: 2 additions & 2 deletions stm32-modules/include/heater-shaker/heater-shaker/flash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ class Flash {

private:
/** Default values for constants.*/
static constexpr double OFFSET_B_DEFAULT_CONST = -0.0210F;
static constexpr double OFFSET_C_DEFAULT_CONST = 0.4970F;
static constexpr double OFFSET_B_DEFAULT_CONST = -0.0259F;
static constexpr double OFFSET_C_DEFAULT_CONST = 0.6755F;

// Whether the constants have been read from the FLASH since startup.
// Even if the FLASH is empty, this flag is set after attempting
Expand Down

0 comments on commit 56961b6

Please sign in to comment.