Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Internal temp] Fix crashes on ESP32-S2/S3/C3 + filter #4834

Merged
merged 2 commits into from Sep 30, 2023

Conversation

TD-er
Copy link
Member

@TD-er TD-er commented Sep 29, 2023

Work-around for bug in ESP-IDF < 5.0
Seems to be fixed in ESP_IDF5.1

temp_sensor_get_config always returns ESP_OK
Thus dac_offset can be just about anything
dac_offset is used as index in an array without bounds checking, thus when internal I2C read to the sensor fails, you get a crash due to out-of-bound array access.

I also added some filtering to make the sensor practically usable.

Old situation, 0.4 degree C resolution, no filtering:
image

Now with filtering:
image

ECO mode enabled at some point:
image

Guess what "task interval" is being set :)
image

@TD-er TD-er merged commit 361894a into letscontrolit:mega Sep 30, 2023
162 checks passed
@TD-er TD-er deleted the bugfix/read_temperature_ESP32 branch September 30, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant