Add small blink example as bootloader payload test
This commit is contained in:
24
blink/bootloader.hpp
Normal file
24
blink/bootloader.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
class Bootloader {
|
||||
public:
|
||||
template <typename Fn>
|
||||
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();
|
||||
};
|
||||
Reference in New Issue
Block a user