Skip to main content
TGhau.2088
Associate II
Oct 16, 2019 8:34 AM UTC
Question

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.

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

This topic has been closed for replies.

2 replies

Pavel A.
Oct 16, 2019 11:18 PM UTC

> 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

Tesla DeLorean
Guru
Oct 16, 2019 11:29 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..