This is an automated email from the ASF dual-hosted git repository. jerpelea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 126be360fa7fe0322a2b4a946b8a0ec0c6a5c8cc Author: Matias Nitsche <[email protected]> AuthorDate: Mon May 11 15:29:46 2020 -0300 stm32: fix NRF24L01 initialization for stm32_tiny --- boards/arm/stm32/stm32_tiny/include/board.h | 14 ++++++++++++++ boards/arm/stm32/stm32_tiny/src/stm32_appinit.c | 8 ++++---- boards/arm/stm32/stm32_tiny/src/stm32_tiny.h | 9 --------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/boards/arm/stm32/stm32_tiny/include/board.h b/boards/arm/stm32/stm32_tiny/include/board.h index 1c827c9..550656d 100644 --- a/boards/arm/stm32/stm32_tiny/include/board.h +++ b/boards/arm/stm32/stm32_tiny/include/board.h @@ -161,4 +161,18 @@ #define LED_ASSERTION 6 /* LED1 + LED2 */ #define LED_PANIC 7 /* LED1 / LED2 blinking */ +/* NRF24L01 Driver **********************************************************/ + +/* NRF24L01 chip enable: PB.1 */ + +#define GPIO_NRF24L01_CE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ + GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) + +/* NRF24L01 IRQ line: PA.0 */ + +#define GPIO_NRF24L01_IRQ (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_PORTA|GPIO_PIN0) + +#define BOARD_NRF24L01_GPIO_CE GPIO_NRF24L01_CE +#define BOARD_NRF24L01_GPIO_IRQ GPIO_NRF24L01_IRQ + #endif /* __ARCH_ARM_STM32_STM32_TINY_INCLUDE_BOARD_H */ diff --git a/boards/arm/stm32/stm32_tiny/src/stm32_appinit.c b/boards/arm/stm32/stm32_tiny/src/stm32_appinit.c index 7dd4b78..106b3fe 100644 --- a/boards/arm/stm32/stm32_tiny/src/stm32_appinit.c +++ b/boards/arm/stm32/stm32_tiny/src/stm32_appinit.c @@ -84,9 +84,9 @@ int board_app_initialize(uintptr_t arg) { -#ifdef CONFIG_PWM - int ret; + int ret = OK; +#ifdef CONFIG_PWM /* Initialize PWM and register the PWM device. */ ret = stm32_pwm_setup(); @@ -99,12 +99,12 @@ int board_app_initialize(uintptr_t arg) #if defined(CONFIG_WL_NRF24L01) /* Initialize the NRF24L01 wireless module */ - ret = board_nrf24l01_initialize(&g_nrf24l01_cfg, 2); + ret = board_nrf24l01_initialize(2); if (ret < 0) { syslog(LOG_ERR, "ERROR: board_nrf24l01_initialize failed: %d\n", ret); } #endif - return OK; + return ret; } diff --git a/boards/arm/stm32/stm32_tiny/src/stm32_tiny.h b/boards/arm/stm32/stm32_tiny/src/stm32_tiny.h index 24a569e..89680e4 100644 --- a/boards/arm/stm32/stm32_tiny/src/stm32_tiny.h +++ b/boards/arm/stm32/stm32_tiny/src/stm32_tiny.h @@ -76,15 +76,6 @@ #define GPIO_NRF24L01_CS (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN12) -/* NRF24L01 chip enable: PB.1 */ - -#define GPIO_NRF24L01_CE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|\ - GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1) - -/* NRF24L01 IRQ line: PA.0 */ - -#define GPIO_NRF24L01_IRQ (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_PORTA|GPIO_PIN0) - /* PWM * * Let's use the LED. It is connected to PB.5, which can be used as PWM output of channel 2 of timer 3
