Normalise the use of float and double data types throughout the code base #55
Replies: 2 comments
-
Hi! I agree, the code base could need an overhaul when it comes to chosen types, efficiency and code cleanliness in general. I created a dev branch where I'll merge your current update to and test on the AxxSolder Hardware. Do you have hardware to test on? |
Beta Was this translation helpful? Give feedback.
-
Hi, No, I don't have the hardware. Can do without it right now, but will need when I start to make the real clean-up. I have reformatted the code (4 headers and 4 c files) with uncrustify, to get better understanding of the code. Could not commit to dev branch, don't have write access. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Currently float and double data types are used more or less randomly, which leads to unnecessary code bloat -- just search AxxSolder_firmware/Debug/AxxSolder.list file for functions __adddf3, __aeabi_dmul, __aeabi_ddiv, and friends.
Is the use of double data type justified? Does it add anything in terms of accuracy or performance? I very much doubt it.
Also, there is a bit of a mess in dealing with floating-point variables:
The chosen MCU has hardware floating point unit, so let's use it to the full.
May I suggest a global rework to put this stuff in order? I could volunteer for this.
Beta Was this translation helpful? Give feedback.
All reactions