I'm using the FSLESL library Rev. 4.2 with micro MC56F84452 (56800EX core) and I'm having a very intriguing issue when I try to put some math operation in the same line of code as in here:
After line 792 is executed the value of park1.Ds is wrongly defined to -1056178177. However, if I separate the operation in three steps (multiply, multiply, then sum) as lines 793-795 show, the value of park1.Ds after line 795 is executed is 49419 which is the expected value:
Does anyone have a good explanation for this behavior?
Regarding your question, I have checked that the 49419 in decimal is 0xC10B, the -1056178177 in decimal is 0x3EF4 0001, the 0xC10B is complementary of 0x3EF4. So they are the same value with different format.
Pls check the variable type of the park1.Ds variable.
Very interesting points. However, it's still hard to understand why the same logic works when it's executed line by line. If I use the function MLIB_Mul_A32 instead of MLIB_MulSat_A32 it works just fine.
Anyways, park1.Ds is a acc32_t variable just like a and b.