Merge pull request #98 from voloved/default_temp_in_simulator
Added default temp of 25C in simulator
This commit is contained in:
commit
77ced0e666
@ -586,6 +586,11 @@ 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;
|
float temperature_c = (float)0xFFFFFFFF;
|
||||||
|
#if __EMSCRIPTEN__
|
||||||
|
temperature_c = EM_ASM_DOUBLE({
|
||||||
|
return temp_c || 25.0;
|
||||||
|
});
|
||||||
|
#else
|
||||||
|
|
||||||
if (movement_state.has_thermistor) {
|
if (movement_state.has_thermistor) {
|
||||||
thermistor_driver_enable();
|
thermistor_driver_enable();
|
||||||
@ -596,6 +601,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