From 8452c571ecb3c215b871f22df5c77ac23440ec96 Mon Sep 17 00:00:00 2001 From: "Virus.V" Date: Mon, 28 Jun 2021 09:59:34 +0800 Subject: [PATCH] risc-v/bl602: BLE firmware adapts to the new framework Signed-off-by: Virus.V --- arch/risc-v/src/bl602/bl602_start.c | 1 + .../bl602/bl602evb/configs/ble/defconfig | 1 + .../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 0503498ab1..f037832c2e 100644 --- a/arch/risc-v/src/bl602/bl602_start.c +++ b/arch/risc-v/src/bl602/bl602_start.c @@ -30,6 +30,7 @@ #include #include #include +#include #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 ff6404e7e6..16fa53ddd1 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 0ee1da2e2b..981308fa54 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