??? 09/24/05 16:50 Read: times |
#101491 - What I am doing with it Responding to: ???'s previous message |
First of all, thanks for the feedback so far. As most seem to indicate, its technically doable, but not considered a standard practice. Just to make sure I am well understood, here is what I wanted to do with it: I have a 8752 that is polling a communicating thermostat over a RS-485 link using the 8752's uart. The interrupt routine that receives the response stores the received byte in a circular buffer and also checks if its a carriage return. If it is, it then sets a bit flag to indicate that a complete response has now been received. The main loop checks this "complete response flag" on every loop and if it is set, then starts to parse the buffer contents, looking for fields such as "SPH=73 SPC=78" (setpoint heat = 73, etc). But there is a remote possibility that the response gets garbled and that a carriage return appears earlier then expected because some characters are missing. The idea was to create a short called routine to get the next byte for comparing/parsing and also check if its a carriage return and if it is, then immediately "return" to the end of the parsing routine and abandon parsing this command because it is invalid. This is the only routine (a long list of compares) that would be using this "called routine with alternate return capability". |
Topic | Author | Date |
RET to a different address | 01/01/70 00:00 | |
here is how pseudocode | 01/01/70 00:00 | |
RET to a different address | 01/01/70 00:00 | |
no flaw, but 1.000.000 gotchas | 01/01/70 00:00 | |
That's what I wanted to know | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
"clever" | 01/01/70 00:00 | |
OT: my wife | 01/01/70 00:00 | |
no flaw, but seriously not recommended | 01/01/70 00:00 | |
experience | 01/01/70 00:00 | |
reload SP | 01/01/70 00:00 | |
restoring stack | 01/01/70 00:00 | |
Recognisable string![]() | 01/01/70 00:00 | |
named return value | 01/01/70 00:00 | |
Bad Practice | 01/01/70 00:00 | |
Well phrased | 01/01/70 00:00 | |
What I am doing with it | 01/01/70 00:00 | |
try...catch | 01/01/70 00:00 | |
setjmp / longjmp | 01/01/70 00:00 | |
when to try ... catch | 01/01/70 00:00 | |
the borderline | 01/01/70 00:00 | |
Promises | 01/01/70 00:00 | |
who cares if an exceptiom is "acceptable | 01/01/70 00:00 | |
Parsing input data | 01/01/70 00:00 |