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;