Skip to main content
TGhau.2088
Associate II
October 16, 2019
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.

  • October 16, 2019
  • 2 replies
  • 1303 views

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

This topic has been closed for replies.

2 replies

Pavel A.
Super User
October 16, 2019

> 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
October 16, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..