Merge pull request #86 from euquiq/better-temperature-graph-on-debug-menu

Nicer debug -> temperature graph
This commit is contained in:
Erwin Ried 2020-06-29 23:10:16 +02:00 committed by GitHub
commit a6e5fa4841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -121,7 +121,7 @@ void TemperatureWidget::paint(Painter& painter) {
} }
TemperatureWidget::temperature_t TemperatureWidget::temperature(const sample_t sensor_value) const { TemperatureWidget::temperature_t TemperatureWidget::temperature(const sample_t sensor_value) const {
return -45 + sensor_value * 5; return -35 + sensor_value * 4; //max2837 datasheet temp 25ºC has sensor value: 15
} }
std::string TemperatureWidget::temperature_str(const temperature_t temperature) const { std::string TemperatureWidget::temperature_str(const temperature_t temperature) const {

View File

@ -101,10 +101,10 @@ private:
std::string temperature_str(const temperature_t temperature) const; std::string temperature_str(const temperature_t temperature) const;
static constexpr temperature_t display_temp_min = 0; static constexpr temperature_t display_temp_min = -10; //Accomodate negative values, present in cold startup cases
static constexpr temperature_t display_temp_scale = 3; static constexpr temperature_t display_temp_scale = 3;
static constexpr int bar_width = 1; static constexpr int bar_width = 1;
static constexpr int temp_len = 3; static constexpr int temp_len = 4; //Now scale shows up to 4 chars ("-10C")
}; };
class TemperatureView : public View { class TemperatureView : public View {