#ifndef STATEDEFS_H
#define STATEDEFS_H

typedef bool (*BootloaderStateMachineHandler)(u32 when, u8 * arg);

#define XX(name) PS_##name
#define XD ,
#define XL ,
enum {
#include "pstates.inc"
  PS_MAX
};
#undef XX
#undef XD
#undef XL

#define XX(name) static bool step##name(u32 when,u8 * packet)
#define XD ;
#define XL ;
#include "pstates.inc"
#undef XX
#undef XD
#undef XL

#define XX(name) step##name
#define XD ,
#define XL
const BootloaderStateMachineHandler (stepFunctions[PS_MAX]) = {
#include "pstates.inc"
};
#undef XX
#undef XD
#undef XL

#endif  /* STATEDEFS_H */
