I try to break the double into all its parts and lobes. My code works, but it is too slow, given that the microcontroller that I use does not have a special multiplication command in the assembly. For instance,
temp = ((int)(tacc - temp);
However, if I do,
temp = (int)(100*(tacc-temp));
I could speed up the microcontroller, but since I try to stay low, I am curious if this can be done faster. This is a small piece that I'm really interested in optimizing:
txBuffer[5] = ((int)tacc_y);
I remember that there is a quick way to multiply by 10 using shifts, so that:
a * 10 = (a << 2 + a) << 1
Perhaps I could nest this and get multiplication by 100. Is there any other way?
source share