Loading...
Searching...
No Matches
bootloader_selection.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Christian Amsüss <chrysn@fsfe.org>
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
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#ifndef RIOTBOOT_BOOTLOADER_SELECTION_H
23#define RIOTBOOT_BOOTLOADER_SELECTION_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Not including GPIO headers: we're not actually *doing* anything on GPIO, and
30 * if no BTN0_PIN is defined we don't define anything either */
31#include <board.h>
32
45#if (!defined(BTN_BOOTLOADER_PIN) && defined(BTN0_PIN) && !defined(BTN_BOOTLOADER_NONE)) || DOXYGEN
46#define BTN_BOOTLOADER_PIN BTN0_PIN
47#endif
48
55#ifndef BTN_BOOTLOADER_MODE
56#define BTN_BOOTLOADER_MODE BTN0_MODE
57#endif
58
65#ifndef BTN_BOOTLOADER_EXT_PULLUP
66#define BTN_BOOTLOADER_EXT_PULLUP false
67#endif
68
74#if !defined(LED_BOOTLOADER_PIN) && defined(LED0_PIN) && !defined(LED_BOOTLOADER_NONE) || DOXYGEN
75#define LED_BOOTLOADER_PIN LED0_PIN
76#define LED_BOOTLOADER_ON LED0_ON
77#define LED_BOOTLOADER_OFF LED0_OFF
78#define LED_BOOTLOADER_TOGGLE LED0_TOGGLE
79#endif
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif /* RIOTBOOT_BOOTLOADER_SELECTION_H */
86