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

Add div by zero check back into WMath::map #4853

Merged
merged 3 commits into from
Feb 24, 2021
Merged

Add div by zero check back into WMath::map #4853

merged 3 commits into from
Feb 24, 2021

Conversation

lbernstone
Copy link
Contributor

The check for divisor==0 was removed in last commit. This is still necessary.

@me-no-dev
Copy link
Member

CI is not happy :) https://github.com/espressif/arduino-esp32/pull/4853/checks?check_run_id=1964101781#step:4:38

Also... how would someone end up in situation where min and max are equal?

@lbernstone
Copy link
Contributor Author

Also... how would someone end up in situation where min and max are equal?

Clearly an error situation, but it should not cause a crash. Let's say you are calibrating something, and you stick the sensor in the low level solution twice instead of the high. You should get an error, without the div by zero crash.

@me-no-dev me-no-dev merged commit 3fe7c2e into espressif:master Feb 24, 2021
@lbernstone lbernstone deleted the map_div0 branch April 17, 2021 13:29
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.

2 participants