I am using hardware serial in on a 20x2 to watch for IR commands from an 08M2. If no commands arrive then a null "255" is generated and sent out into the program. I trap the null with an IF...THEN test to prevent the 255 from going out into the program where I don't want it.
Question: Is there a way to rewrite the DO WHILE loop so that a null never leaves the loop in the first place, but anything other than a null does get out?
Question: Is there a way to rewrite the DO WHILE loop so that a null never leaves the loop in the first place, but anything other than a null does get out?
Code:
HSERSETUP B9600_32,5
Main:
DO
'inside loop to accept commands
DO WHILE ptr<>hserptr
CmdCode = @ptrinc
LOOP
'reject null command
IF CmdCode = 255 THEN
GOTO Main
ENDIF