diff options
Diffstat (limited to 'include/btsel.h')
-rw-r--r-- | include/btsel.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/btsel.h b/include/btsel.h new file mode 100644 index 0000000..9d2c676 --- /dev/null +++ b/include/btsel.h @@ -0,0 +1,19 @@ +#pragma once + +// Header file for detecting bootsel button presses. + +#define PASTER(x, y) x##y +#define CONCAT(x, y) PASTER(x, y) + +typedef void (*bootsel_cb_t)(void); +#define On_BootSelPress() \ + static void __local_on_bootsel__(void); \ + __attribute__(( \ + __section__(".bootsel_callbacks"))) static volatile bootsel_cb_t \ + __bootsel__position = __local_on_bootsel__; \ + static void __local_on_bootsel__() + +#undef PASTER +#undef CONCAT + +void enable_bootsel_button(void); |