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 */
8
9#pragma once
10
20
21/* Include guards and cplusplus are more of a formality; this header is local
22 * to the riotboot_dfu application that isn't written in C++ and not included
23 * from anywhere else either, but still here for consistency (and because
24 * otherwise the checks complain) */
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/* Not including GPIO headers: we're not actually *doing* anything on GPIO, and
31 * if no BTN0_PIN is defined we don't define anything either */
32#include <board.h>
33
46#if (!defined(BTN_BOOTLOADER_PIN) && defined(BTN0_PIN) && !defined(BTN_BOOTLOADER_NONE)) || DOXYGEN
47#define BTN_BOOTLOADER_PIN BTN0_PIN
48#endif
49
56#ifndef BTN_BOOTLOADER_MODE
57#define BTN_BOOTLOADER_MODE BTN0_MODE
58#endif
59
66#ifndef BTN_BOOTLOADER_EXT_PULLUP
67#define BTN_BOOTLOADER_EXT_PULLUP false
68#endif
69
75#if !defined(LED_BOOTLOADER_PIN) && defined(LED0_PIN) && !defined(LED_BOOTLOADER_NONE) || DOXYGEN
76#define LED_BOOTLOADER_PIN LED0_PIN
77#define LED_BOOTLOADER_ON LED0_ON
78#define LED_BOOTLOADER_OFF LED0_OFF
79#define LED_BOOTLOADER_TOGGLE LED0_TOGGLE
80#endif
81
82#ifdef __cplusplus
83}
84#endif
85