Download this file
#ifndef STATE_MACHINE_H
#define STATE_MACHINE_H

#include "leffakone_timer.h"
#include "timer.h"
#include "blinker.h"

#define IDLE 0
#define WAITING_WAKEUP 1
#define WAITING_RESET 2


class WakeupTimer;
class ResetTimer;

class StateMachine {

  public:
    StateMachine(WakeupTimer * wakeup_timer, ResetTimer * reset_timer, Blinker * blinker):
      state(IDLE),
      wakeup_timer(wakeup_timer),
      reset_timer(reset_timer),
      blinker(blinker)
      {
        pinMode(POWER_BUTTON_PIN, OUTPUT);
#ifdef ENABLE_RESET
        pinMode(RESET_BUTTON_PIN, OUTPUT);
#endif
      };
    void input(uint32_t value);
    void wakeup();
#ifdef ENABLE_RESET
    void reset();
#endif

  private:
    uint8_t state;
    WakeupTimer * wakeup_timer;
    ResetTimer * reset_timer;
    Blinker * blinker;
};
#endif
// vim:ft=arduino