You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/06/28 12:03:15 UTC
[incubator-nuttx] 02/02: risc-v/bl602: BLE firmware adapts to the
new framework
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 8452c571ecb3c215b871f22df5c77ac23440ec96
Author: Virus.V <vi...@live.com>
AuthorDate: Mon Jun 28 09:59:34 2021 +0800
risc-v/bl602: BLE firmware adapts to the new framework
Signed-off-by: Virus.V <vi...@live.com>
---
arch/risc-v/src/bl602/bl602_start.c | 1 +
boards/risc-v/bl602/bl602evb/configs/ble/defconfig | 1 +
boards/risc-v/bl602/bl602evb/src/bl602_bringup.c | 47 ----------------------
3 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/arch/risc-v/src/bl602/bl602_start.c b/arch/risc-v/src/bl602/bl602_start.c
index 0503498..f037832 100644
--- a/arch/risc-v/src/bl602/bl602_start.c
+++ b/arch/risc-v/src/bl602/bl602_start.c
@@ -30,6 +30,7 @@
#include <nuttx/init.h>
#include <nuttx/arch.h>
#include <arch/board/board.h>
+#include <syslog.h>
#ifdef CONFIG_STACK_OVERFLOW_CHECK
# include "sched/sched.h"
diff --git a/boards/risc-v/bl602/bl602evb/configs/ble/defconfig b/boards/risc-v/bl602/bl602evb/configs/ble/defconfig
index ff6404e..16fa53d 100644
--- a/boards/risc-v/bl602/bl602evb/configs/ble/defconfig
+++ b/boards/risc-v/bl602/bl602evb/configs/ble/defconfig
@@ -44,6 +44,7 @@ CONFIG_INTELHEX_BINARY=y
CONFIG_LIBC_PERROR_STDOUT=y
CONFIG_LIBC_STRERROR=y
CONFIG_MAX_TASKS=16
+CONFIG_MM_CIRCBUF=y
CONFIG_MQ_MAXMSGSIZE=1024
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
diff --git a/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c b/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c
index 0ee1da2..981308f 100644
--- a/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c
+++ b/boards/risc-v/bl602/bl602evb/src/bl602_bringup.c
@@ -70,25 +70,10 @@
* Private Function Prototypes
****************************************************************************/
-#if defined(CONFIG_BL602_BLE_CONTROLLER)
-static void bl602_net_poll_work(FAR void *arg);
-static void ble_hci_rx_poll_expiry(wdparm_t arg);
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
-#if defined(CONFIG_BL602_BLE_CONTROLLER)
-/* BLE HCI timer */
-
-static struct wdog_s g_ble_hci_rx_poll;
-
-/* For deferring poll work to the work queue */
-
-static struct work_s g_ble_hci_rx_work;
-#endif
-
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -99,7 +84,6 @@ extern int bl602_net_initialize(void);
#if defined(CONFIG_BL602_BLE_CONTROLLER)
extern void bl602_hci_uart_init(uint8_t uartid);
-extern int ble_hci_do_rx(void);
#endif
/****************************************************************************
@@ -306,11 +290,6 @@ int bl602_bringup(void)
#if defined(CONFIG_BL602_BLE_CONTROLLER)
bl602_hci_uart_init(0);
-
- /* 50ms interval */
-
- wd_start(&g_ble_hci_rx_poll,
- 1 * CLOCKS_PER_SEC / 20, ble_hci_rx_poll_expiry, (wdparm_t)NULL);
#endif /* CONFIG_BL602_BLE_CONTROLLER */
#ifdef CONFIG_FS_ROMFS
@@ -341,29 +320,3 @@ int bl602_bringup(void)
return ret;
}
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-#if defined(CONFIG_BL602_BLE_CONTROLLER)
-static void bl602_net_poll_work(FAR void *arg)
-{
- ble_hci_do_rx();
-
- /* 50ms interval */
-
- wd_start(&g_ble_hci_rx_poll,
- 1 * CLOCKS_PER_SEC / 20, ble_hci_rx_poll_expiry, (wdparm_t)NULL);
-}
-
-static void ble_hci_rx_poll_expiry(wdparm_t arg)
-{
- UNUSED(arg);
-
- if (work_available(&g_ble_hci_rx_work))
- {
- work_queue(LPWORK, &g_ble_hci_rx_work, bl602_net_poll_work, NULL, 0);
- }
-}
-#endif