sforkowany z mirror/meshtastic-firmware
Fix typo "Fahrenheit"
rodzic
285413c68c
commit
a530249503
2
proto
2
proto
|
@ -1 +1 @@
|
|||
Subproject commit f9885d5e92dea1bb2f668705968add0e32667c8a
|
||||
Subproject commit a4ebed7b563fc4b95acd90fca2dcf8fcd2a09287
|
|
@ -21,4 +21,3 @@ PB_BIND(RadioConfig_UserPreferences, RadioConfig_UserPreferences, 2)
|
|||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ typedef struct _RadioConfig_UserPreferences {
|
|||
uint32_t telemetry_module_read_error_count_threshold;
|
||||
uint32_t telemetry_module_update_interval;
|
||||
uint32_t telemetry_module_recovery_interval;
|
||||
bool telemetry_module_display_farenheit;
|
||||
bool telemetry_module_display_fahrenheit;
|
||||
RadioConfig_UserPreferences_TelemetrySensorType telemetry_module_sensor_type;
|
||||
uint32_t telemetry_module_sensor_pin;
|
||||
bool store_forward_module_enabled;
|
||||
|
@ -299,7 +299,7 @@ extern "C" {
|
|||
#define RadioConfig_UserPreferences_telemetry_module_read_error_count_threshold_tag 142
|
||||
#define RadioConfig_UserPreferences_telemetry_module_update_interval_tag 143
|
||||
#define RadioConfig_UserPreferences_telemetry_module_recovery_interval_tag 144
|
||||
#define RadioConfig_UserPreferences_telemetry_module_display_farenheit_tag 145
|
||||
#define RadioConfig_UserPreferences_telemetry_module_display_fahrenheit_tag 145
|
||||
#define RadioConfig_UserPreferences_telemetry_module_sensor_type_tag 146
|
||||
#define RadioConfig_UserPreferences_telemetry_module_sensor_pin_tag 147
|
||||
#define RadioConfig_UserPreferences_store_forward_module_enabled_tag 148
|
||||
|
@ -392,7 +392,7 @@ X(a, STATIC, SINGULAR, BOOL, telemetry_module_screen_enabled, 141) \
|
|||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_read_error_count_threshold, 142) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_update_interval, 143) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_recovery_interval, 144) \
|
||||
X(a, STATIC, SINGULAR, BOOL, telemetry_module_display_farenheit, 145) \
|
||||
X(a, STATIC, SINGULAR, BOOL, telemetry_module_display_fahrenheit, 145) \
|
||||
X(a, STATIC, SINGULAR, UENUM, telemetry_module_sensor_type, 146) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_sensor_pin, 147) \
|
||||
X(a, STATIC, SINGULAR, BOOL, store_forward_module_enabled, 148) \
|
||||
|
|
|
@ -55,7 +55,7 @@ int32_t TelemetryModule::runOnce()
|
|||
radioConfig.preferences.telemetry_module_read_error_count_threshold = 5;
|
||||
radioConfig.preferences.telemetry_module_update_interval = 600;
|
||||
radioConfig.preferences.telemetry_module_recovery_interval = 60;
|
||||
radioConfig.preferences.telemetry_module_display_farenheit = false;
|
||||
radioConfig.preferences.telemetry_module_display_fahrenheit = false;
|
||||
radioConfig.preferences.telemetry_module_sensor_pin = 13;
|
||||
|
||||
radioConfig.preferences.telemetry_module_sensor_type =
|
||||
|
@ -185,7 +185,7 @@ uint32_t GetTimeSinceMeshPacket(const MeshPacket *mp)
|
|||
return delta;
|
||||
}
|
||||
|
||||
float TelemetryModule::CelsiusToFarenheit(float c)
|
||||
float TelemetryModule::CelsiusToFahrenheit(float c)
|
||||
{
|
||||
return (c * 9) / 5 + 32;
|
||||
}
|
||||
|
@ -216,8 +216,8 @@ void TelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state,
|
|||
|
||||
display->setFont(FONT_SMALL);
|
||||
String last_temp = String(lastMeasurement.temperature, 0) + "°C";
|
||||
if (radioConfig.preferences.telemetry_module_display_farenheit) {
|
||||
last_temp = String(CelsiusToFarenheit(lastMeasurement.temperature), 0) + "°F";
|
||||
if (radioConfig.preferences.telemetry_module_display_fahrenheit) {
|
||||
last_temp = String(CelsiusToFahrenheit(lastMeasurement.temperature), 0) + "°F";
|
||||
}
|
||||
display->drawString(x, y += fontHeight(FONT_MEDIUM) - 2, "From: " + lastSender + "(" + String(agoSecs) + "s)");
|
||||
display->drawString(x, y += fontHeight(FONT_SMALL) - 2,"Temp/Hum: " + last_temp + " / " + String(lastMeasurement.relative_humidity, 0) + "%");
|
||||
|
|
|
@ -28,7 +28,7 @@ class TelemetryModule : private concurrency::OSThread, public ProtobufModule<Tel
|
|||
bool sendOurTelemetry(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false);
|
||||
|
||||
private:
|
||||
float CelsiusToFarenheit(float c);
|
||||
float CelsiusToFahrenheit(float c);
|
||||
bool firstTime = 1;
|
||||
const MeshPacket *lastMeasurementPacket;
|
||||
uint32_t sensor_read_error_count = 0;
|
||||
|
|
Ładowanie…
Reference in New Issue