We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello everyone,
I am using the PGA400 from Texas Instruments (an 8051W processor) with uVision V4.02 and have traced an issue back to using a switch statement in the commBuff ISR. It appears to either have corrupted or overflowed some sort of variable (this might not be the case but that's what it appears to have done). I've replaced it from:
switch (CommandState) { case (0): // random code here break; }
to:
if(CommandState==0) { // random code here }
This seems to have fixed my problem for whatever reason. Is it a common practice to avoid using switch statements in an ISR or is this a Keil related issue? Any help you can give me would be appreciated. Thanks a lot!
Because our scope interprets the commands in terms of hex values. I could go the other way and reference the characters but then I'd just have to comment what the hex values are. Truthfully, I can look at a chart, it's just to save me time when looking at the code and the scope. It's for my own use more than anyone else's.