void main(void) {
OSCCON = 0b01110110;
for (; ;) {
for(unsigned int i = 0; i< 100; i++) {
}
return; // this starts all over? wrong or Right?
}
}
I was messing with some LCD code that had returns in it that was stopping it in one loop
Been reading up and there not much about using it in a for loop
I no about the for ( ; ; ) loop what I couldn't find is how return is working there nothing really about it in any thing I found on the xc8 nothing showing it used with a for loop .
What's happening is like you said the code runs to the return and the pic reboots cause as soon as it hits it the messes up the LCD
I guess it's a poor way to restart main.
But I don't no enough about xc8 LOL