EX_SISR.C - how do I look for a specific charachter?
Posted: Sat Jun 12, 2004 2:08 pm
Hi
The CSC EX_SISR.C works just fine - but how do I search the buffer for a unique charachter?
Rgds
Jesper
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
Start Char
Posted: Sat Jun 12, 2004 4:21 pm
If you are looking for one specific character (for example one to start a packet) , the best place to check is in the ISR. Check the incoming character in the ISR to see if it is the desired start char then set a START Flag true.
Every time you enter the ISR for an incoming char you check the START flag.
IF START is false THEN you check the incoming char for (compare against) the START char ELSE IF it is true THEN you put the incoming char straight in the buffer.
If you are looking for more than one start char it may get somewhat more complicated depending on how many you need to match..
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum