Add small blink example as bootloader payload test
This commit is contained in:
30
blink/main.cpp
Normal file
30
blink/main.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "clock.hpp"
|
||||
|
||||
#include "io/io.hpp"
|
||||
|
||||
#include "bootloader.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
io::Pin<io::P::B5> ledPin;
|
||||
ledPin.dir(io::Dir::OUT);
|
||||
ledPin = false;
|
||||
|
||||
Bootloader::init([&ledPin]() {
|
||||
for (uint8_t i = 0; i < 10; ++i) {
|
||||
ledPin = true;
|
||||
_delay_ms(50);
|
||||
ledPin = false;
|
||||
_delay_ms(50);
|
||||
}
|
||||
});
|
||||
|
||||
for (uint8_t i = 0; i < 10; ++i) {
|
||||
ledPin.toggle();
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
Bootloader::enter();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user