From 3ff28bb1ad32eb5dd3985808a2ef4af597f98a48 Mon Sep 17 00:00:00 2001 From: stark1898y <1658608470@qq.com> Date: Thu, 12 Dec 2024 09:17:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=B8=B2=E5=8F=A3=E6=B3=A2?= =?UTF-8?q?=E7=89=B9=E7=8E=87=E6=94=B9=E5=88=B01500000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/peripheral.c | 9 ++++++--- StdPeriphDriver/CH59x_uart1.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/APP/peripheral.c b/APP/peripheral.c index 9ae7ba7..37acb08 100644 --- a/APP/peripheral.c +++ b/APP/peripheral.c @@ -40,7 +40,7 @@ #define SBP_PHY_UPDATE_DELAY 2400 // What is the advertising interval when device is discoverable (units of 625us, 80=50ms) -#define DEFAULT_ADVERTISING_INTERVAL (160 * 10) +#define DEFAULT_ADVERTISING_INTERVAL (160 * 1) // Limited discoverable mode advertises for 30.72s, and then stops // General discoverable mode advertises indefinitely @@ -741,9 +741,12 @@ static void peripheralStateNotificationCB(gapRole_States_t newState, gapRoleEven */ static void performPeriodicTask(void) { - uint8_t notiData[SIMPLEPROFILE_CHAR4_LEN] = {0x11, 0x22, 0x33, 0x44}; + static uint8_t counter = 0; + uint8_t notiData[SIMPLEPROFILE_CHAR4_LEN] = {0x11, 0x22, 0x33, 0x44, 0}; + notiData[4] = counter; // peripheralChar4Notify(notiData, SIMPLEPROFILE_CHAR4_LEN); - peripheralChar4Notify(notiData, 4); + peripheralChar4Notify(notiData, 5); + counter++; } /********************************************************************* diff --git a/StdPeriphDriver/CH59x_uart1.c b/StdPeriphDriver/CH59x_uart1.c index 60ccd47..f804eda 100644 --- a/StdPeriphDriver/CH59x_uart1.c +++ b/StdPeriphDriver/CH59x_uart1.c @@ -23,7 +23,7 @@ */ void UART1_DefInit(void) { - UART1_BaudRateCfg(921600); + UART1_BaudRateCfg(1500000); R8_UART1_FCR = (2 << 6) | RB_FCR_TX_FIFO_CLR | RB_FCR_RX_FIFO_CLR | RB_FCR_FIFO_EN; // FIFO打开,触发点4字节 R8_UART1_LCR = RB_LCR_WORD_SZ; R8_UART1_IER = RB_IER_TXD_EN;