mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-23 21:34:35 +03:00
FDX-B temperature in system units (#2941)
* FDX-B temperature now uses system units * LF-RFID: wrap floats in fdx-b temperature conversion Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
4c771b66dc
commit
1e4af1d550
@ -4,6 +4,7 @@
|
||||
#include <toolbox/manchester_decoder.h>
|
||||
#include <lfrfid/tools/bit_lib.h>
|
||||
#include "lfrfid_protocols.h"
|
||||
#include <furi_hal_rtc.h>
|
||||
|
||||
#define FDX_B_ENCODED_BIT_SIZE (128)
|
||||
#define FDX_B_ENCODED_BYTE_SIZE (((FDX_B_ENCODED_BIT_SIZE) / 8))
|
||||
@ -323,8 +324,12 @@ void protocol_fdx_b_render_brief_data(ProtocolFDXB* protocol, FuriString* result
|
||||
|
||||
float temperature;
|
||||
if(protocol_fdx_b_get_temp(protocol->data, &temperature)) {
|
||||
float temperature_c = (temperature - 32) / 1.8;
|
||||
furi_string_cat_printf(result, "T: %.2fC", (double)temperature_c);
|
||||
if(furi_hal_rtc_get_locale_units() == FuriHalRtcLocaleUnitsMetric) {
|
||||
float temperature_c = (temperature - 32.0f) / 1.8f;
|
||||
furi_string_cat_printf(result, "T: %.2fC", (double)temperature_c);
|
||||
} else {
|
||||
furi_string_cat_printf(result, "T: %.2fF", (double)temperature);
|
||||
}
|
||||
} else {
|
||||
furi_string_cat_printf(result, "T: ---");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user