message: Add NO_GUI_DEV_MODE, for running the controller without a GUI.
  Super hacky, I apologize.
  GPC: dev-mode
diff: @@ -61,12 +61,63 @@ static ControllerStatus controller_status = ControllerStatus_init_zero;
  // Last-received status from the GUI.
  static GuiStatus gui_status = GuiStatus_init_zero;
  +// NO_GUI_DEV_MODE is a hacky development mode until we have the GUI working.
  +//
  +// Uncomment this line to get started:
  +//
  +// #define NO_GUI_DEV_MODE
  +//
  +// Then see comment on DEV_MODE_comms_handler below.
  +//
  +// TODO: Remove NO_GUI_DEV_MODE once the GUI is working.
  +#ifdef NO_GUI_DEV_MODE
  +// Fake "development mode" version of sending and receiving data over the
  +// network.
  +//
  +// "Receives" data from the "GUI" just by setting gui_status directly. Change
  +// these params and reflash to simulate the GUI changing its settings.
  +//
  +// "Sends" data to the "GUI" via a simple serial protocol. This can be parsed
  +// and graphed by e.g. the Arduino IDE (tools -> serial plotter).
  +static void DEV_MODE_comms_handler() {
  + gui_status.desired_params.mode = VentMode_PRESSURE_CONTROL;
  + gui_status.desired_params.breaths_per_min = 10;
  + gui_status.desired_params.peep_cm_h2o = 10;
  + gui_status.desired_params.pip_cm_h2o = 30;
  + gui_status.desired_params.inspiratory_expiratory_ratio = 2;
  +
  + static Time last_sent = Hal.now();
  + Time now = Hal.now();
  + if (now - last_sent < seconds(0.1)) {
  + return;
  + }
  + last_sent = now;
  + Serial.print(controller_status.fan_setpoint_cm_h2o);
  + Serial.print(',');
  + Serial.print(controller_status.sensor_readings.pressure_cm_h2o);
  + Serial.print(',');
  + Serial.print(controller_status.sensor_readings.flow_ml_per_min / 1000.0f);
  + Serial.print(',');
  + Serial.print(controller_status.sensor_readings.volume_ml);
  + Serial.println();
  +}
  +#endif
  +
  static void controller_loop() {
  while (true) {
  controller_status.uptime_ms = Hal.millis();
  +
  +#ifndef NO_GUI_DEV_MODE
  comms_handler(controller_status, &gui_status);
  +#else
  + DEV_MODE_comms_handler();
  +#endif
  +
  controller_status.active_params = gui_status.desired_params;
  + // TODO: Add additional fields to the ControllerStatus proto:
  + // - Blower speed (0-255 PWM value)
  + // - Expiratory solenoid valve state (open/closed).
  BlowerSystemState desired_state =
  blower_fsm_desired_state(controller_status.active_params);
  controller_status.fan_setpoint_cm_h2o = desired_state.pressure.cmH2O();
  