#pragma once
#ifndef WHILL_GLOBAL_H
#define WHILL_GLOBAL_H

#include <Arduino.h>

#define WHILL_SERIAL_L Serial2
#define WHILL_SERIAL_R Serial3
#define XBEE_SERIAL Serial1

static constexpr uint32_t WHILL_SERIAL_BAUD = 38400;
static constexpr uint32_t XBEE_SERIAL_BAUD = 38400;
static constexpr uint16_t WHILL_INFO_INTERVAL_MS = 500;

static constexpr double XBEE_COMMAND_TIMEOUT_MS = 1000.;

uint8_t HARDWARE_ID = 0xFF;
bool b_need_xbee_init = false;

static constexpr uint8_t PIN_EMERGENCY = 32;
static constexpr uint8_t PIN_IRLED_OE = 17;
bool b_motor_active = true;
bool b_streaming = true;
uint16_t streaming_interval = 1000;

struct XBeeSettings
{
    uint8_t channel;
    uint16_t pan_id;
    uint32_t dst_addr_h;
    uint32_t dst_addr_l;
    uint8_t packetization_timeout;
};
XBeeSettings xb_settings[6];

#endif // WHILL_GLOBAL_H
