Dlloydev / QuickPID

A fast PID controller with multiple options. Various Integral anti-windup, Proportional, Derivative and timer control modes.
MIT License
195 stars 50 forks source link

Avoid double promotion in QuickPID::Compute() #40

Closed guilhermgonzaga closed 2 years ago

guilhermgonzaga commented 2 years ago

Hello. This is a small issue I caught with the compiler option Wdouble-promotion. It does not matter for AVR, of course, but it does make a difference in other platforms such as Espressif.

Quote from ESP-IDF docs:

ESP32 does not support hardware acceleration for double precision floating point arithmetic (double). Instead double is implemented via software hence the behavioral restrictions with regards to float do not apply to double. Note that due to the lack of hardware acceleration, double operations may consume significantly larger amount of CPU time in comparison to float.

Dlloydev commented 2 years ago

Looks good, thanks.