sebmaster
Member level 1
Hello,
In the program for my AVR32 I have a state machine, within this state machine there is the case:
This code works at the moment (currentMemoryBank is just another variable used to prove a point), however should I add any code which causes the variable currentLVDS to be given a new value based on itself, for example:
or:
It freezes up on the second execution of that case.
I have determined it freezes up after a long session of placing various breakpoints around and trying different bits of code because the debugger just exits with an error "bad file descriptor" and no more information.
I'm at a loss for words with this one, anyone seen anything like it?
EDIT: The variable is within scope and its not a pointer/reference or anything of the sort. The code is a word-for-word copy of another lot within the same state machine that works fine, just with one variable and one function name changed.
I know the function isnt causing the problem because if I rewrite this section to assign currentLVDS anything but a function of itself, it works fine indefinately through multiple calls.
Also:
Works just fine.
In the program for my AVR32 I have a state machine, within this state machine there is the case:
Code:
case 10:
usart_putchar(usart,ACK);
graphicsSetLVDStxEnable(currentLVDS);
currentLVDS = currentMemoryBank;
state = 1;
break;
This code works at the moment (currentMemoryBank is just another variable used to prove a point), however should I add any code which causes the variable currentLVDS to be given a new value based on itself, for example:
Code:
if(currentLVDS)
currentLVDS = 0;
else
currentLVDS = 1;
or:
Code:
currentLVDS = (int)(currentLVDS == 1);
It freezes up on the second execution of that case.
I have determined it freezes up after a long session of placing various breakpoints around and trying different bits of code because the debugger just exits with an error "bad file descriptor" and no more information.
I'm at a loss for words with this one, anyone seen anything like it?
EDIT: The variable is within scope and its not a pointer/reference or anything of the sort. The code is a word-for-word copy of another lot within the same state machine that works fine, just with one variable and one function name changed.
I know the function isnt causing the problem because if I rewrite this section to assign currentLVDS anything but a function of itself, it works fine indefinately through multiple calls.
Also:
Code:
currentLVDS2 = currentLVDS;
currentLVDS = (int)(!currentLVDS2);