// src/hardware/button.h
#pragma once
#include "mbed.h"

enum class ButtonEvent {
  None = 0,
  Pressed = 1,
};

class ButtonHandler {
private:
  InterruptIn button;
  DigitalOut led;
  volatile bool pressed_flag = false;
  volatile bool blink_flag = false;

  void on_pressed();

public:
  ButtonHandler(PinName pin = BUTTON1, PinName led_pin = LED1);

  ButtonEvent poll();
};
