movement_get_temperature no longer returns early in case logic after reading will ever be needed
This commit is contained in:
parent
877d972190
commit
018c94f23d
@ -587,13 +587,13 @@ bool movement_set_accelerometer_motion_threshold(uint8_t new_threshold) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float movement_get_temperature(void) {
|
float movement_get_temperature(void) {
|
||||||
|
float temperature_c = (float)0xFFFFFFFF;
|
||||||
#if __EMSCRIPTEN__
|
#if __EMSCRIPTEN__
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
return EM_ASM_DOUBLE({
|
temperature_c = EM_ASM_DOUBLE({
|
||||||
return temp_c || 25.0;
|
return temp_c || 25.0;
|
||||||
});
|
});
|
||||||
#endif
|
#else
|
||||||
float temperature_c = (float)0xFFFFFFFF;
|
|
||||||
|
|
||||||
if (movement_state.has_thermistor) {
|
if (movement_state.has_thermistor) {
|
||||||
thermistor_driver_enable();
|
thermistor_driver_enable();
|
||||||
@ -604,6 +604,7 @@ float movement_get_temperature(void) {
|
|||||||
val = val >> 4;
|
val = val >> 4;
|
||||||
temperature_c = 25 + (float)val / 16.0;
|
temperature_c = 25 + (float)val / 16.0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return temperature_c;
|
return temperature_c;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user