mirror of
https://github.com/joeycastillo/second-movement.git
synced 2025-12-01 12:24:53 +00:00
Merge pull request #98 from voloved/default_temp_in_simulator
Added default temp of 25C in simulator
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user