We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35caf4b commit b4848cfCopy full SHA for b4848cf
src/platform/avr/boot.c
@@ -0,0 +1,24 @@
1
+/*
2
+ * SPDX-License-Identifier: MIT
3
+ * SPDX-FileCopyrightText: 2022 Rafael Silva <[email protected]>
4
+ */
5
+
6
+#include <avr/wdt.h>
7
8
+// Assuming the Caterina bootloader that comes with the 32u4
9
+uint16_t bootKey = 0x7777;
10
+volatile uint16_t *const bootKeyPtr = (volatile uint16_t *) 0x0800;
11
12
+void reset()
13
+{
14
+ wdt_enable(WDTO_15MS);
15
+ for (;;) {
16
+ }
17
+}
18
19
+void bootloader()
20
21
+ *bootKeyPtr = bootKey;
22
23
+ reset();
24
src/platform/avr/boot.h
@@ -0,0 +1,8 @@
+void reset() __attribute__((noreturn));
+void bootloader() __attribute__((noreturn));
+;
0 commit comments