#ifndef CONFIG_H
  #define CONFIG_H

  #define MCU_VARIANT RPI_PICO

  #define MTU  255
  #define CMD_L       4
  int     lastRssi = -292;
  uint8_t lastRssiRaw = 0x00;
  size_t  readLength = 0;

  #if MCU_VARIANT == RPI_PICO
    const int pinNSS = 10;
    const int pinNRST = 9;
    const int pinDIO0 = 2;
    // const int pinLedRx = 5;
    // const int pinLedTx = 4;

  #endif

  const long serialBaudRate   = 38400;
  const int  rssiOffset      = 292;

  const int  loraRxTurnaround = 50;

  // Default LoRa settings
  int       loraSpreadingFactor = 12;
  int       loraPreamble        = 8;
  int       loraCodingRate      = 5;
  int       loraTxPower         = 17;
  int       LoRaPaSelect        = 1;
  uint32_t  loraBandwidth       = 125E3;
  uint32_t  loraFrequency       = 433775000;

  uint8_t txBuffer[MTU];
  uint8_t rxBuffer[MTU];

  uint32_t statRx = 0;
  uint32_t statTx = 0;

  bool outboundReady = false;

  bool statSignalDetected = false;
  bool statSignalSynced   = false;
  bool statRxOngoing      = false;
  bool dcd                = false;
  bool dcdLed             = false;
  bool dcdWaiting         = false;
  uint16_t dcdCount       = 0;
  uint16_t dcdThreshold   = 15;

  uint32_t statusIntervalms = 3;
  uint32_t lastStatusUpdate = 0;

  // Status flags
  const uint8_t SIG_DETECT = 0x01;
  const uint8_t SIG_SYNCED = 0x02;
  const uint8_t RX_ONGOING = 0x04;

#endif
