??? 03/03/05 08:47 Read: times |
#88949 - Bizarre! Responding to: ???'s previous message |
Rahul Sadagopan said:
my while(1) has all the characters that need to be printed..
as soon as my timer overflows, i need to come out of the loop, and go to the next line. ( i.e. trigger paper feed). What a bizarre approach! As I said before, if you simply jump out of your loop you have no idea where you had got to in the loop - so how will you know where you had got to in your text?! How will you know which is the next character to start printing on the next line? Surely all you need to do is to count the characters as you print them, and insert a newline every nth character?! characters_printed := 0; while not end-of-text { print the next character; increment characters_printed; if characters_printed >= max characters per line { print newline; characters_printed := 0 } } the timing has to be accurate..cause i dont want charaters printing beyond the margin.... Another good reason for not doing it this way! i was wondering if the break statement will work because
when break is included in the ISR will it break out of the isr only or out of the main. Absolutely not - see any 'C' text book 'break' affects only its containing loop. |