Hi there!
I'm currently planning a project based on TMS320F28335.
At this moment, from my boss, I've gotten legacy project(SW) that is generated for TMS320C2812.
And he'd like to re-use those source codes for my new project.
Also he'd like to minimize the code change because those codes could be re-used for Fixed Point machine.
However! His legacy codes were implemented by Qmath(not by IQmath) like this!
/* All variables are defined as "int" type */
/* Let's say Vas_ref, Vbs_ref, Vcs_ref, Vsn is Q5 */
Van_ref = Vas_ref + Vsn;
Vbn_ref = Vbs_ref + Vsn;
Vcn_ref = Vcs_ref + Vsn;
/* Let's say INV_Vdc is Q23 */
Ta = 0x2000 - ((long)Van_ref*(long)INV_Vdc >> 14); // Q(5 + 23 - 14)
Tb = 0x2000 - ((long)Vbn_ref*(long)INV_Vdc >> 14); // Q(5 + 23 - 14)
Tc = 0x2000 - ((long)Vcn_ref*(long)INV_Vdc >> 14); // Q(5 + 23 - 14)
Here is my query.
What's the best practice to minimize the change in my legacy code?
Is there any reference document for solving this prolem?
I'd like to fully utilize the FPU performance of 28335 !!!
That is, I'd like to define my variables as "float" type instead of "int" type!
I'm looking forward to your answer.
Thanks.