Merge pull request #98 from voloved/default_temp_in_simulator

Added default temp of 25C in simulator
This commit is contained in:
voloved 2025-11-21 08:49:38 -05:00 committed by GitHub
commit 77ced0e666
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -586,6 +586,11 @@ bool movement_set_accelerometer_motion_threshold(uint8_t new_threshold) {
float movement_get_temperature(void) {
float temperature_c = (float)0xFFFFFFFF;
#if __EMSCRIPTEN__
temperature_c = EM_ASM_DOUBLE({
return temp_c || 25.0;
});
#else
if (movement_state.has_thermistor) {
thermistor_driver_enable();
@ -596,6 +601,7 @@ float movement_get_temperature(void) {
val = val >> 4;
temperature_c = 25 + (float)val / 16.0;
}
#endif
return temperature_c;
}