|
Post by DarioG on Dec 17, 2019 22:35:43 GMT
Back in 2017, XC16 failed to perform correctly the (simple) math in this loop (as opposite to C30):
#ifdef __XC16 // il porcodidio di XC16 non fa la somma (con O1) ..., 5.10.17 ValueF[0]+=gradient[0]; CalcTriac(0,ValueF[0]); ValueF[1]+=gradient[1]; CalcTriac(1,ValueF[1]); ValueF[2]+=gradient[2]; CalcTriac(2,ValueF[2]); #else for(i=0; i<3; i++) { ValueF[i]+=gradient[i]; CalcTriac(i,ValueF[i]); } #endif
...as written above (!) unrolling the loop did the trick. I opened a Ticket @microchip, but after 1month ping-pong of useless replies (...) I let it go. That's the way it goes...
PS: C30 v.325 or 31 was being used on a PIC24FV32 while XC16 current version at the time was being used on a PIC24EP and/or PIC24FJ..GA - I've not retested with latest updates. Variables are declared float.
|
|
|
Post by du00000001 on Dec 18, 2019 0:14:02 GMT
Not absolutely sure, but declaring ValueF[] as volatile might have worked.
|
|
|
Post by DarioG on Jan 5, 2020 14:38:50 GMT
sorry for being late, back now I doubt it since, IIRC, it was the math that used to come out wrong but... well, I might try again, also with new compilers etc. thank u!
|
|
|
Post by du00000001 on Jan 5, 2020 23:07:50 GMT
Nothing to be sorry about.
Wish you a happy and prosperous New Year! du00000001
|
|
|
Post by DarioG on Jan 6, 2020 17:00:28 GMT
|
|