#include "variables.h"

volatile uint8_t pin_value = 0x00U;
volatile uint16_t adc_value = 0x0000U;

volatile uint8_t UART1[2] = {0x00U, 0x00U};
volatile uint8_t receive[4] = {0x00U, 0x00U, 0x00U, 0x00U};
volatile uint8_t motor_ctrl_buffer[2] = {0x00U, 0x00U};

volatile float rpm_left = 0.0f;
volatile float rpm_right = 0.0f;
volatile float pitch_deg = 0.0f;
volatile float pitch_offset = 0.0f;
volatile uint16_t adc_raw = 0U;
volatile float adc_voltage = 0.0f;
volatile float battery_voltage = 0.0f;

volatile uint8_t uart_frame_valid = 0U;
volatile uint32_t uart_frame_ok_count = 0U;
volatile uint32_t uart_frame_err_count = 0U;
volatile uint8_t mpu_online = 0U;
volatile uint8_t adc_ready = 0U;

volatile uint8_t esp_link_ready = 0U;
volatile uint8_t esp_link_stage = 0U;
volatile uint32_t esp_link_ok_count = 0U;
volatile uint32_t esp_link_retry_count = 0U;
volatile uint32_t esp_rx_byte_count = 0U;
volatile uint32_t esp_tx_byte_count = 0U;
uint8_t esp_wifi_connected = 0;

volatile uint8_t net_seq = 0U;
volatile uint8_t net_move_cmd = 0U;
volatile uint8_t net_led_cmd = 0U;
volatile uint8_t net_yun_cmd = 0U;
volatile uint32_t net_last_cmd_tick = 0U;
volatile uint32_t net_frame_ok_count = 0U;
volatile uint32_t net_feedback_ok_count = 0U;
volatile uint32_t net_feedback_fail_count = 0U;

volatile GasSlotState_t gas_slot1 = {0U};
volatile GasSlotState_t gas_slot2 = {0U};
