From 8f55070fefc9edde12a09fe00e2e8d512e8ddd34 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期一, 19 四月 2021 10:54:49 +0800 Subject: [PATCH] V1.21 更改SFD模式 --- Src/main.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Src/main.c b/Src/main.c index 40c9556..4eb8b08 100644 --- a/Src/main.c +++ b/Src/main.c @@ -128,7 +128,8 @@ // g_com_map[MOTOR_ONTIME]--; // motor_state = 1; // } - +if(motor_enable) +{ switch(motor_state) {case 0: MOTOR_OFF; @@ -149,6 +150,9 @@ MOTOR_OFF; break; } +}else{ + MOTOR_OFF; +} if(HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)) { nomove_count = 0; @@ -242,7 +246,7 @@ Usart1ParseDataCallback = UsartParseDataHandler; parameter_init(); //deca_sleep(1000); - g_com_map[VERSION] = 0x0111; + g_com_map[VERSION] = 0x0115; #ifdef DEBUG_MODE // g_com_map[DEV_ROLE]=1; // g_com_map[DEV_ID]=1; @@ -250,7 +254,6 @@ // g_com_map[MAX_REPORT_ANC_NUM]=1; g_com_map[NOMOVESLEEP_TIME]=10; #endif - if(g_com_map[COM_INTERVAL]==0) { g_com_map[COM_INTERVAL]=100; @@ -356,7 +359,7 @@ Dw1000_App_Init(); dwt_configuresleep(DWT_PRESRV_SLEEP | DWT_CONFIG, DWT_WAKE_CS | DWT_WAKE_WK| DWT_SLP_EN); - //dwt_entersleep(); + dwt_entersleep(); waitusart_timer=tag_frequency*USART_KEEPWAKE_TIME;; DW_DISABLE; if(HAL_UART_Receive_DMA(&huart1,m_EUART_DMA_RXBuf,EUART_RX_BUF_SIZE)) @@ -408,7 +411,8 @@ } if(m_bEUARTTxEn==0&&waitusart_timer==0&&(motor_state==0||motor_state==3)) { -#ifndef DEBUG_MODE +#ifndef DEBUG_MODE +if(!HAL_GPIO_ReadPin(INPUT_5V_GPIO_Port,INPUT_5V_Pin)) HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); #endif } -- Gitblit v1.9.3