diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-10-03 09:53:00 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-10-03 09:53:00 +0200 |
commit | 10f83102061c3d7d0d6a506c3feb149ef067eb0e (patch) | |
tree | f1b018409e1c8c59655fa254bf836cd378220c51 /src/common/Core/main.c | |
parent | 6206140d8db1a3b46a78b25a1ac7ded65b920e8a (diff) | |
download | glutte-o-matic-10f83102061c3d7d0d6a506c3feb149ef067eb0e.tar.gz glutte-o-matic-10f83102061c3d7d0d6a506c3feb149ef067eb0e.tar.bz2 glutte-o-matic-10f83102061c3d7d0d6a506c3feb149ef067eb0e.zip |
Fix TEMP printout
Diffstat (limited to 'src/common/Core/main.c')
-rw-r--r-- | src/common/Core/main.c | 11 |
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"); |