| ??? 08/03/05 17:20 Read: times |
#98778 - 1) no it is not the weekly puzzle, that Responding to: ???'s previous message |
1) no it is not the weekly puzzle, that is on hold till when and if Craig establishes a format for everybody to submit puzzles.
2) what is wrong is that it will very likely hang you, the solution (sketched in C - same principle should be in asm) for (timeout = some high number; timeout !=0 ; timeout--)
{
if (RI) break;
}
if (!RI) timeout_error(HERE); // this routine does not return
else
{
RI = 0;
...
...
}
// this routine does not return
// it reports the error and times the watchdog out to reset the processor
void timeout_error(U8 where){
...
...Erik
PS note the neat use of the "break" instead of packing all conditions into the for loop. It makes the program soooo much more readable. |



