From 26576b10250e5d38763c5026937c9f38fcf25dd0 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期三, 03 十一月 2021 18:12:36 +0800 Subject: [PATCH] 测试 --- Src/main.c | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Src/main.c b/Src/main.c index f86dcd2..e263881 100644 --- a/Src/main.c +++ b/Src/main.c @@ -109,6 +109,7 @@ Error_Handler(); } } +u8 active_flag=0; uint16_t hardware_version,hardware_pici,hardware_type; u16 current_time; uint8_t state5v; @@ -129,15 +130,15 @@ // LED_TB_OFF; //}else{ // LED_TR_OFF; -// while(1) -// { -// current_time=HAL_LPTIM_ReadCounter(&hlptim1); -// if(current_time-beepcount>3||beepcount>current_time) -// { -// beepcount = current_time; -// LED_BLINK(GPIOA, GPIO_PIN_11); -// } -//} +if(active_flag) + { + current_time=HAL_LPTIM_ReadCounter(&hlptim1); + if(current_time-beepcount>3||beepcount>current_time) + { + beepcount = current_time; + LED_BLINK(GPIOA, GPIO_PIN_11); + } +} //motor_state=2; @@ -311,7 +312,7 @@ if(g_com_map[POWER]<0) {g_com_map[POWER]=0;} } -u8 active_flag=0; + void Program_Init(void) { float temp; uint16_t temp2; @@ -339,11 +340,12 @@ // g_com_map[IMU_ENABLE]=0; // g_com_map[COM_INTERVAL]=1000; active_flag = g_com_map[ACTIVE_INDEX]; + g_com_map[COM_INTERVAL]=50; if(active_flag==0) { g_com_map[COM_INTERVAL]=1000; g_com_map[IMU_ENABLE]=1; - g_com_map[NOMOVESLEEP_TIME]=10; + g_com_map[NOMOVESLEEP_TIME]=3; g_com_map[MOTOR_ENABLE]=0; } //g_com_map[HEIGHTOFFEST_INDEX]=g_com_map[MAX_REPORT_ANC_NUM]; @@ -469,7 +471,7 @@ { Error_Handler(); } - + LED_BLINK(GPIOA, GPIO_PIN_11); // HAL_Delay(2000); // mcu_sleep(); //LED0_BLINK; -- Gitblit v1.9.3