1 of 1 people found this helpful
I would suggest to set the optimization to "none". Might help a bit. Optimized-out code lines cannot take breakpoints.
Your "error" might be that you have no return value and the parameter "byte" needs to be passed as an address (* uint8) to return a value to the calling program.
Hi Bob and thanks for the reply, we are at 98% code in this design, and so I cannot do that as it make the code too big for the memory. Why would it optimize out the code? I did try to use a pointer, and it failed as well, also if you use a pointer you cannot have the VAR be a volatile?
When you modularized your code (different files) you can set the optimization levelfor each file individually.
When you creaate a small project that isolates your error I could try to debug it and solve that problem.
Optimize out: The line
bit = 1 << bit;
is in both if-branches and will be put before the if.