From 11e18b858bdcd74f9830c6c2d7c949f6902b76c2 Mon Sep 17 00:00:00 2001 From: Marven Gilhespie <45208741+marvensilabs@users.noreply.github.com> Date: Wed, 17 Jul 2019 16:50:42 +0100 Subject: [PATCH] [efr32] Removed hal-config-board.h from sleepy-demo, moved needed defines into brdxxxx/hal-config.h (#4004) Fixes build error on efr32mg12/brd4304a that resulted in a conflicting define of BSP_LED_POLARITY. Removed hal-config-board.h from sleepy demo and moved some definitions into each hal-config.h in order to build. --- examples/platforms/efr32mg12/brd4161a/hal-config.h | 12 ++++++++++++ examples/platforms/efr32mg12/brd4166a/hal-config.h | 12 ++++++++++++ examples/platforms/efr32mg12/brd4304a/hal-config.h | 12 ++++++++++++ .../efr32mg12/sleepy-demo/sleepy-demo-ftd/main.c | 2 +- .../efr32mg12/sleepy-demo/sleepy-demo-mtd/main.c | 2 +- 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/examples/platforms/efr32mg12/brd4161a/hal-config.h b/examples/platforms/efr32mg12/brd4161a/hal-config.h index 6dada3a7c..20b658d32 100644 --- a/examples/platforms/efr32mg12/brd4161a/hal-config.h +++ b/examples/platforms/efr32mg12/brd4161a/hal-config.h @@ -33,6 +33,18 @@ // [BULBPWM_COLOR]$ // $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT { { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) // [BUTTON]$ // $[CMU] diff --git a/examples/platforms/efr32mg12/brd4166a/hal-config.h b/examples/platforms/efr32mg12/brd4166a/hal-config.h index 3eb99a2b3..ea5bda6dd 100644 --- a/examples/platforms/efr32mg12/brd4166a/hal-config.h +++ b/examples/platforms/efr32mg12/brd4166a/hal-config.h @@ -33,6 +33,18 @@ // [BULBPWM_COLOR]$ // $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (14U) +#define BSP_BUTTON0_PORT (gpioPortD) + +#define BSP_BUTTON1_PIN (15U) +#define BSP_BUTTON1_PORT (gpioPortD) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT { { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) // [BUTTON]$ // $[CMU] diff --git a/examples/platforms/efr32mg12/brd4304a/hal-config.h b/examples/platforms/efr32mg12/brd4304a/hal-config.h index d56f69018..dfad6651d 100644 --- a/examples/platforms/efr32mg12/brd4304a/hal-config.h +++ b/examples/platforms/efr32mg12/brd4304a/hal-config.h @@ -33,6 +33,18 @@ // [BULBPWM_COLOR]$ // $[BUTTON] +#define BSP_BUTTON_PRESENT (1) + +#define BSP_BUTTON0_PIN (6U) +#define BSP_BUTTON0_PORT (gpioPortF) + +#define BSP_BUTTON1_PIN (7U) +#define BSP_BUTTON1_PORT (gpioPortF) + +#define BSP_BUTTON_COUNT (2U) +#define BSP_BUTTON_INIT { { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN } } +#define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW) +#define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT) // [BUTTON]$ // $[CMU] diff --git a/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-ftd/main.c b/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-ftd/main.c index 9b68a48b1..24aba9bc8 100644 --- a/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-ftd/main.c +++ b/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-ftd/main.c @@ -30,7 +30,7 @@ #include "em_cmu.h" #include "em_emu.h" #include "gpiointerrupt.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "hal_common.h" #include "openthread-system.h" #include "rtcdriver.h" diff --git a/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-mtd/main.c b/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-mtd/main.c index cc9f014f8..ab406fe59 100644 --- a/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-mtd/main.c +++ b/examples/platforms/efr32mg12/sleepy-demo/sleepy-demo-mtd/main.c @@ -33,7 +33,7 @@ #include "em_cmu.h" #include "em_emu.h" #include "gpiointerrupt.h" -#include "hal-config-board.h" +#include "hal-config.h" #include "hal_common.h" #include "openthread-system.h" #include "platform-efr32.h"