diff --git a/APP/multiCentral_main.c b/APP/multiCentral_main.c index 1b5dfea..4f8869c 100644 --- a/APP/multiCentral_main.c +++ b/APP/multiCentral_main.c @@ -2,7 +2,7 @@ * @Author: mbw * @Date: 2024-12-03 11:13:13 * @LastEditors: mbw && 1600520629@qq.com - * @LastEditTime: 2024-12-15 17:16:45 + * @LastEditTime: 2025-04-13 22:40:51 * @FilePath: \ble_-tyq_-bjq_-ch584-m\APP\multiCentral_main.c * @Description: * @@ -104,7 +104,7 @@ int main(void) BSP_FLASH_Init(); BSP_Valve_Init(); BSP_UART1_Init(); // BT UART - // IWDG_Init(1000); + IWDG_Init(1000); Main_Circulation(); } diff --git a/bsp/src/bsp_iwdg.c b/bsp/src/bsp_iwdg.c index 41eb3ea..7217e1e 100644 --- a/bsp/src/bsp_iwdg.c +++ b/bsp/src/bsp_iwdg.c @@ -2,7 +2,7 @@ * @Author : stark1898y 1658608470@qq.com * @Date : 2024-12-15 16:13:41 * @LastEditors: mbw && 1600520629@qq.com - * @LastEditTime: 2024-12-16 10:50:56 + * @LastEditTime: 2025-04-13 22:42:49 * @FilePath: \ble_-tyq_-bjq_-ch584-m\bsp\src\bsp_iwdg.c * @Description : * @@ -31,7 +31,7 @@ uint16_t IWDG_ProcessEvent(uint8_t task_id, uint16_t events) if (events & IWIG_FEED_EVENT) { FEED_IWDG(); - tmos_start_task(task_id, IWIG_FEED_EVENT, 10000); + tmos_start_task(task_id, IWIG_FEED_EVENT, 2000); return (events ^ IWIG_FEED_EVENT); } return 0; @@ -62,9 +62,8 @@ void IWDG_Init(uint16_t ms) R32_IWDG_KR = 0x5555; // 解除IWDG保护 R32_IWDG_CFG |= (7 << 12); // 32K分频512,时钟62.5Hz R32_IWDG_CFG &= 0xFFFFF000; - R32_IWDG_CFG |= 0x10; // 看门狗时间约256ms(0x10/(32K/512)) + R32_IWDG_CFG |= 0x7D; // 看门狗时间约256ms(0x10/(32K/512)) R32_IWDG_KR = 0xCCCC; - PRINT("R32_IWDG_CFG = %x\r\n", R32_IWDG_CFG); IWDGTaskId = TMOS_ProcessEventRegister(IWDG_ProcessEvent); tmos_set_event(IWDGTaskId, IWIG_FEED_EVENT); diff --git a/bsp/src/bsp_uart.c b/bsp/src/bsp_uart.c index e4f541d..0370491 100644 --- a/bsp/src/bsp_uart.c +++ b/bsp/src/bsp_uart.c @@ -316,6 +316,8 @@ uint16_t BSP_Send_Process(uint8_t *pdata) logError("不支持的命令: %d", master_rx_buf[1]); break; } + + return 0; } uint16_t BT_ProcessEvent(uint8_t task_id, uint16_t events) @@ -556,6 +558,8 @@ void BSP_Uart3_Send_Loop(void) int reboot(void) { PFIC_SystemReset(); + + return 0; } SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC), reboot, reboot, "reboot");