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

STM32 LIBDIVIDE Division by 0 causes mcu hang #1162

Closed
gdiciocco opened this issue Jan 4, 2024 · 1 comment
Closed

STM32 LIBDIVIDE Division by 0 causes mcu hang #1162

gdiciocco opened this issue Jan 4, 2024 · 1 comment

Comments

@gdiciocco
Copy link

gdiciocco commented Jan 4, 2024

static libdivide::libdivide_s16_t divTriggerToothAngle;

https://github.com/ridiculousfish/libdivide/blob/ee2a872b85648b16c0a65faa8cb646fa7e9e903a/libdivide.h#L95

Division by 0 on non-AVR mcus causes libdivide call abort() which ends up in a noreturn

Issue was submitted to libdivide:
ridiculousfish/libdivide#112

@noisymime
Copy link
Owner

This is largely resolved by 7c26de6

It doesn't specifically check for a 0 value, but will mean that a new board where this is defaulted to 0 will not freeze on first startup

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

No branches or pull requests

2 participants