From 1b83e716601b4c7ba981a00be6ecf24a9d549d52 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期三, 20 一月 2021 10:18:56 +0800 Subject: [PATCH] V2.20 1.增加静止时间判定参数,测距有BUG抖动较大 --- Src/main.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Src/main.c b/Src/main.c index 10eba42..8afe2fe 100644 --- a/Src/main.c +++ b/Src/main.c @@ -297,7 +297,7 @@ hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2); hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4); //deca_sleep(1000); - g_com_map[VERSION] = 0x0213; + g_com_map[VERSION] = 0x0214; // g_com_map[DEV_ID]=0x11; #ifdef DEBUG_MODE // g_com_map[DEV_ROLE]=1; @@ -388,7 +388,7 @@ break; case 2: MX_TIM2_Init(); - BarInit(); + //BarInit(); break; } } @@ -427,10 +427,10 @@ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_LPTIM1_Init(); + MX_DMA_Init(); MX_USART1_UART_Init(); MX_SPI1_Init(); MX_ADC_Init(); - MX_DMA_Init(); //MX_TIM2_Init(); /* USER CODE BEGIN 2 */ LED_LG_ON; @@ -469,7 +469,7 @@ { static uint16_t blink_count=0; SystemClock_Config(); g_start_send_flag = 0; - GetPressAndTemp(); + // GetPressAndTemp(); // if(current_count>slot_startcount&¤t_count<slot_startcount+interval_count) // { // HAL_GPIO_WritePin(LED0_GPIO, GPIO_PIN_9, GPIO_PIN_SET); @@ -1001,7 +1001,7 @@ }else{ key_keeptime=0; } - if(nomove_count>STATIONARY_TIME) + if(nomove_count>g_com_map[STATIONARY_TIME]) { stationary_flag = 1; }else{ @@ -1028,12 +1028,12 @@ { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; - /* USER CODE END W1_HardFault_IRQn 0 */ - } +// while (1) +// { +// /* USER CODE BEGIN W1_HardFault_IRQn 0 */ +// //SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; +// /* USER CODE END W1_HardFault_IRQn 0 */ +// } /* USER CODE END Error_Handler_Debug */ } -- Gitblit v1.9.3