Add small blink example as bootloader payload test

This commit is contained in:
2020-04-12 18:45:33 +02:00
parent b21673e326
commit 9390f7830b
10 changed files with 498 additions and 119 deletions

24
blink/bootloader.hpp Normal file
View 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();
};