   Channel::init(channels);
   erri = 0;
   alive = 0;
-  runlevel = RUNSET;
+  runlevel = RUN_PROGRAM;
 }
 
 void process_refresh() {
-  if (runlevel == RUNSTOP) {
+  if (runlevel == RUN_COMPLETED) {
     Channel::refresh(channels, protocols);
-    runlevel = RUNSET;  
+    runlevel = RUN_PROGRAM;  
   }
 }
 

    for (int i = 0; i < n && erri < MSGN; i++) { char c = what[i]; msg[erri] = c; if (c == 0) break; erri += 1; }
    for (int i = 0; i < m && erri < MSGN; i++) { char c = detail[i]; msg[erri] = c; if (c == 0) break; erri += 1; }
  }
  if (runlevel != ERRDONE) runlevel = ERRSTOP;
}

void error_with_message(const char* what, const char* detail, int m) { error_with_message(what, MSGN, detail, m); }

 *******************/

Channel* process_get_channel(byte ch) {
  if (ch >= 'A' && (ch < ('A'+DIG) || ch == 'Z')) return channels + ((ch == 'Z') ? DIG : (ch - 'A'));
  else {
    error_with_message("Unknown channel ", (char)ch);
    return &not_a_channel; 
  }
}

Protocol* process_get_protocol(byte ch) {
  Channel *c = process_get_channel(ch);
  if (c->who != 255) return protocols + c->who;
  else {
    error_with_message("No protocol for channel ", (char)ch);
    return &not_a_protocol;
  }
}
