#pragma once class Bootloader { public: template static inline void init(Fn callback) { if (handleReset()) { callback(); call(); } } static inline void enter() { reset(); } private: static bool handleReset(); static void reset(); static bool check(); static void call(); };