-
Notifications
You must be signed in to change notification settings - Fork 5
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
Minimize floating point operations #212
Comments
I've looked at the t400 code and I think the floating point operations can be replaced with int16 values. The int16 would have a range of -35535 to 35535, if the values were stored as base 10 with a resolution of 1/10th degree the supported range would be -3553.5C to 3553.5C. The base 10 division and modulo operations would be must faster and take less code space than the floating point. |
I think I need some more information on the temperature vs microvolt lookup in the code. I see the following functions, where did they come from? If we can eliminate some of these floating point operations the code will be smaller and faster From GetJunctionVoltage(): From GetTypKTemp(): |
@protological Can this be closed now that #220 is merged? |
Not all the float operations have been removed. The mentioned algorithms use floating point values. Maybe we need to keep some floats |
I've managed to reduce the floating point math quite a bit, however there are still a few hold outs t400.ino functions.c If we can get some details on the math in these functions I might be able to translate them to integer math operations |
There are many bast ten floating point operations. If possible, let's make things base 16 and use bit shift math. This should save a bunch of flash space since the floating point library is pretty big.
The text was updated successfully, but these errors were encountered: