aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/Core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Core/main.c')
-rw-r--r--src/common/Core/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/Core/main.c b/src/common/Core/main.c
index f2aaf93..52f1663 100644
--- a/src/common/Core/main.c
+++ b/src/common/Core/main.c
@@ -502,9 +502,16 @@ static void gps_monit_task(void __attribute__ ((unused))*pvParameters) {
}
if (temperature_valid()) {
- const float temp = temperature_get();
+ float temp = temperature_get();
stats_temp(temp);
- usart_debug("TEMP %d.%02d\r\n", (int)temp, (int)(temp * 100.0f - (int)(temp) * 100.0f));
+
+ const char *sign = "";
+ if (temp < 0) {
+ sign = "-";
+ temp = -temp;
+ }
+
+ usart_debug("TEMP %s%d.%02d\r\n", sign, (int)temp, (int)(temp * 100.0f - (int)(temp) * 100.0f));
}
else {
usart_debug("TEMP invalid\r\n");