comparison Discovery/Src/unit.c @ 653:269e57ac4e56

Bugfix temperature display Logpage2: Temperature was shown in Centidegrees (Fahrenheit as well as Celsius). Root cause was that conversion was done via character cutting (string: removal of last digit). This has been replaced by a factor 10 devision.
author Ideenmodellierer
date Sun, 25 Apr 2021 20:36:18 +0200
parents 1c95f811967c
children
comparison
equal deleted inserted replaced
652:f6212495f34f 653:269e57ac4e56
105 { 105 {
106 return input_celsius * (9.0f/5.0f) + 32; 106 return input_celsius * (9.0f/5.0f) + 32;
107 } 107 }
108 } 108 }
109 109
110 uint16_t unit_temperature_integer(uint16_t input_celsius) 110 int16_t unit_temperature_integer(int16_t input_celsius)
111 { 111 {
112 if(settingsGetPointer()->nonMetricalSystem == 0) 112 if(settingsGetPointer()->nonMetricalSystem == 0)
113 return input_celsius; 113 return input_celsius;
114 else 114 else
115 { 115 {
116 return ((input_celsius * 9 / 5) + 320); 116 return ((input_celsius * 9 / 5) + 32);
117 } 117 }
118 } 118 }
119 119
120 uint16_t unit_speed_integer(uint16_t input_meterPerMinute) 120 uint16_t unit_speed_integer(uint16_t input_meterPerMinute)
121 { 121 {