2009-10-08 04:09 AM
STM8S103 problem with ++
2011-05-17 06:05 AM
Dear All
I have a too strange behaviour with the following code: while (HS_Values_X[uC++] < Conversion_Values[0]); HallAngle[0] = HS_ANGLE_X[uC-1]; In fact, by following the code step by step with the debugger uC variable increase three by three any step (and not by one). I changed the firwmare: while (HS_Values_X[uC] < Conversion_Values[0]) { uC++; } HallAngle[0] = HS_ANGLE_X[uC-1]; but I obtain the same strange behaviour. Why? Some one could help me!?! I have set the compiler in order to minimize the code size. Thanks2011-05-17 06:05 AM
Hi Genius,
The uC variable should be declaration as volatile... thanks to check this point. Regards mozra2011-05-17 06:05 AM
I solved and the problem is the STVD IDE, in fact I had the HS_Values_X[uC++] term in the Watch. By removing it from the watch all work.
For some strange reason the Watch modify the variable :-Y thanks