bootloader_selection.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020 Christian Amsüss <chrysn@fsfe.org>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 /* Include guards and cplusplus are more of a formality; this header is local
19  * to the riotboot_dfu application that isn't written in C++ and not included
20  * from anywhere else either, but still here for consistency (and because
21  * otherwise the checks complain) */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Not including GPIO headers: we're not actually *doing* anything on GPIO, and
28  * if no BTN0_PIN is defined we don't define anything either */
29 #include <board.h>
30 
43 #if (!defined(BTN_BOOTLOADER_PIN) && defined(BTN0_PIN) && !defined(BTN_BOOTLOADER_NONE)) || DOXYGEN
44 #define BTN_BOOTLOADER_PIN BTN0_PIN
45 #endif
46 
53 #ifndef BTN_BOOTLOADER_MODE
54 #define BTN_BOOTLOADER_MODE BTN0_MODE
55 #endif
56 
63 #ifndef BTN_BOOTLOADER_EXT_PULLUP
64 #define BTN_BOOTLOADER_EXT_PULLUP false
65 #endif
66 
72 #if !defined(LED_BOOTLOADER_PIN) && defined(LED0_PIN) && !defined(LED_BOOTLOADER_NONE) || DOXYGEN
73 #define LED_BOOTLOADER_PIN LED0_PIN
74 #define LED_BOOTLOADER_ON LED0_ON
75 #define LED_BOOTLOADER_OFF LED0_OFF
76 #define LED_BOOTLOADER_TOGGLE LED0_TOGGLE
77 #endif
78 
79 #ifdef __cplusplus
80 }
81 #endif
82