#pragma once
/* uart_ota_recv.h — IO board: receives OTA firmware from Balance (bd-21hv) */

#include <stdint.h>
#include <stdbool.h>

typedef enum {
    IO_OTA_IDLE       = 0,
    IO_OTA_RECEIVING,
    IO_OTA_VERIFYING,
    IO_OTA_APPLYING,
    IO_OTA_REBOOTING,
    IO_OTA_FAILED,
} io_ota_state_t;

extern volatile io_ota_state_t g_io_ota_state;
extern volatile uint8_t        g_io_ota_progress;

/* Start listening for OTA frames on UART0 */
void uart_ota_recv_init(void);
