 
 #include "SerialProtocol.h"
 
+const int SERIAL_BAUDRATE = 115200;
+const int SERIAL_TEXT_TIMEOUT = 60000;
+const int SERIAL_BINARY_TIMEOUT = 5000;
+
 // Command and response terminator
 const char SERIAL_TERMINATOR = '\r';
 

  uint16_t *table = waveform_table(params[0]);
  size_t length = sizeof(uint16_t) * g_waveform_length;

  respond_data_request(length);
  size_t bytes = Serial.readBytes((char *)table, length);
  if (bytes < length) {
    respond_error(DFGERR_TIMEOUT);
    return;


  clear_debug_message();

  Serial.begin(SERIAL_BAUDRATE);
  Serial.setTimeout(SERIAL_TEXT_TIMEOUT);

  setup_spi_dac();
  setup_tc_sampler();
