hi,
im trying to read a led using the function Dio_ReadChannel. my code is written as shown below:
while (1)
{
Dio_WriteChannel(DioConf_DioChannel_myled, STD_HIGH);
TestDelay(5000000);
Dio_ReadChannel(DioConf_DioChannel_myled);
if ( Dio_ReadChannel(DioConf_DioChannel_myled) == true)
{
x = 1;
}
else
x=0;
im always getting x as an optimized out:
i want to see the value of my variable can anyone help me?
thank you.
Solved! Go to Solution.
Go to the project properties -> C/C++ Build -> Settings -> Optimization.
It means you compiled an optimization level different than the default, so the gcc optimizer found that some of your variables were redundant in some way that allowed them to be optimized away. Compile with optimization disabled if you want to see such variables (this is generally a good idea for debug builds in any case).
B.R.
VaneB