cancel
Showing results for 
Search instead for 
Did you mean: 

I am using Keil IDE and during debugging in the call stack + locals window the variables I have defined are appearing as not in scope.

TGhau.2088
Associate II

I am getting warnings that AccY, AccZ and Avg are not being used.

2 REPLIES 2
Pavel A.
Evangelist III

> I am getting warnings that AccY, AccZ and Avg are not being used.

Usually the compiler is correct.

Try to disable optimization. Optimization removes unused code and variables.

As you see, lines 144, 145 are optimized out.

-- pa

Probably in a register in MCU and FPU. Look at the actual assembler generated and where it is holding the values.

Get rid of all the delays, and print values to a console. Shouldn't need to step this stuff.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..