Being a hardware guy I'm sure when it comes to coding I do many things incorrectly even though they give the appearance of 'working'. My question is in the following block of code (notice wr), is it ok to re-use wr in the next for loop down the line rather than re-introducing another variable? I have many for loop type activity and it seems to me that once the loop has been completed and the next loop is purposeful in re-assignment that it would be an ok thing to do...
adv = 0;
for (wr = 4; wr < 8; wr++) {
if (permanent_Info[wr] == '0')
adv++;
}
if (adv == 4) {
adv = 0;
SYSCFG0 =0xA501; //unlock write to info memory
for (wr = 4; wr < 8; wr++)
permanent_Info[wr] = rxID[wr - 4];
SYSCFG0 =0xA503; //lock write to info memory
Thank you
Steve