 void refresh_channel(Channel *c) {
   c->e = (ChannelError){0, 0, 0, 0, 0, 0, 0, 0};
   c->t = c->yn = c->pq = (Dura){0, 0};
-  c->runlevel = 0;
+  c->runlevel = C_ZZZ;
   c->who = zero;
 }
 

  bool started_yn = false;
  bool started_pq = false;
tail_recurse:
  if (c->disabled || c->runlevel == 0) return (Dura){0,0};
  if (c->runlevel == 1) {
    // Only relevant times are c->t and c->yn
    bool use_yn = lt_dura(c->yn, c->d);
    Dura *x = use_yn ? &(c->yn) : &(c->t);

      if (pq_first) {
        sub_duras(&(c->yn), c->pq);
        sub_duras(&(c->t), c->pq);
        if (c->runlevel == C_LO) {
          channel_pin_on(c, ps);
          started_pq = true;
          c->runlevel = C_HI;
          c->pq = ps[c->who].q;
          c->e.npuls++;
          // TODO--timing errors here!
        }
        else {
          channel_pin_off(c, ps);
          c->runlevel = C_LO;
          c->pq = ps[c->who].q;
          if (started_pq) { started_pq = false; c->e.pmiss++; }
        }
      }
      else if (yn_first) {
        sub_duras(&(c->t), c->pq);
        if (c->runlevel == C_HI) channel_pin_off(c, ps);
        c->runlevel = C_WAIT;
        c->yn = ps[c->who].z;
        if (started_pq) { started_pq = false; c->e.pmiss++; }
        if (started_yn) { started_yn = false; c->e.nmiss++; }
