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){
...
...