             error_with_message("Bad duration format: ", (char*)buf, 11);
           }
         }
-        bufi = shift_buffer(buf, bufi, 11);
+        discard_buf(11);
         return;
       case 'a': /* TODO */ return;
       default:
         error_with_message("Channel command not valid (setting): ", (char*)buf, 3);
     }
-    bufi = shift_buffer(buf, bufi, 3);
+    discard_buf(3);
   }
   else {
     switch(b) {

        case GOGOGO: process_runtime_command(); break;
        default: break;
      }
      now = ARM_DWT_CYCCNT;
      delta = now - tick;
      tick = now;
      global_clock += delta;
      io_anyway = global_clock;
      io_anyway += MHZ * MAX_BUSY_US;
      yell("p");
    }
    else yell("_");
  }
  delay(100);
}

  if (bufi < 2) return;
  if (buf[0] != '~') {
    error_with_message("Channel command not valid(running): ", (char*)buf, 2);
    discard_command();
    return;
  }
  byte b = buf[1];
