1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/common/e104-bt50xxa-tb: enable software reset

This commit is contained in:
Benjamin Valentin 2020-11-24 23:09:42 +01:00
parent 5f4afe12f1
commit 0b83589bbc
4 changed files with 25 additions and 6 deletions

View File

@ -2,4 +2,11 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
# used for software reset
ifneq (,$(filter board_software_reset,$(USEMODULE)))
FEATURES_REQUIRED += periph_gpio_irq
endif
DEFAULT_MODULE += board_software_reset
include $(RIOTBOARD)/common/nrf52/Makefile.dep

View File

@ -20,6 +20,9 @@
#include "cpu.h"
#include "board.h"
#include "periph/gpio.h"
extern void pm_reboot(void*);
void board_init(void)
{
@ -27,6 +30,12 @@ void board_init(void)
LED_PORT->DIRSET = (LED_MASK);
LED_PORT->OUTSET = (LED_MASK);
/* configure software RST button */
#ifdef MODULE_BOARD_SOFTWARE_RESET
gpio_init_int(BTN0_PIN, BTN0_MODE, GPIO_FALLING,
pm_reboot, NULL);
#endif
/* initialize the CPU */
cpu_init();
}

View File

@ -43,18 +43,20 @@ static const saul_gpio_params_t saul_gpio_params[] =
.mode = GPIO_OUT,
.flags = SAUL_GPIO_INVERTED,
},
{
.name = "BTN (RTS)",
.pin = BTN0_PIN,
.mode = BTN0_MODE,
.flags = SAUL_GPIO_INVERTED,
},
{
.name = "BTN (DBG)",
.pin = BTN1_PIN,
.mode = BTN1_MODE,
.flags = SAUL_GPIO_INVERTED,
},
#ifndef MODULE_BOARD_SOFTWARE_RESET
{
.name = "BTN (RST)",
.pin = BTN0_PIN,
.mode = BTN0_MODE,
.flags = SAUL_GPIO_INVERTED,
},
#endif
};
#ifdef __cplusplus

View File

@ -6,6 +6,7 @@ PSEUDOMODULES += at_urc_isr_highest
PSEUDOMODULES += at24c%
PSEUDOMODULES += atomic_utils
PSEUDOMODULES += base64url
PSEUDOMODULES += board_software_reset
PSEUDOMODULES += can_mbox
PSEUDOMODULES += can_pm
PSEUDOMODULES += can_raw