From 1560ba22c98a3ddb13710d3592e20eeea8af7616 Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期六, 04 四月 2020 20:19:40 +0800
Subject: [PATCH] 测距快完成,有bug,DW无法测距

---
 Inc/main.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Inc/main.h b/Inc/main.h
index fa3c2b8..07f257d 100644
--- a/Inc/main.h
+++ b/Inc/main.h
@@ -35,6 +35,8 @@
 #include "Usart.h"
 #include "serial_at_cmd_app.h"
 #include "led.h"	
+#include "dw_app.h"
+#include "global_param.h"
 /* USER CODE END Includes */
 
 /* Exported types ------------------------------------------------------------*/
@@ -43,11 +45,14 @@
 extern UART_HandleTypeDef huart1;
 extern uint8_t g_start_send_flag;
 extern ADC_HandleTypeDef hadc;
+extern LPTIM_HandleTypeDef hlptim1;
+extern uint16_t lastpoll_count,interval_count,slot_startcount;
 /* USER CODE END ET */
 
 /* Exported constants --------------------------------------------------------*/
 /* USER CODE BEGIN EC */
-
+#define LPTIMER_LSB 30.518 //1 puls=30.518us
+#define LPTIMER_1S_COUNT 33095
 /* USER CODE END EC */
 
 /* Exported macro ------------------------------------------------------------*/
@@ -84,6 +89,8 @@
 #define LED1_R_GPIO_Port GPIOB
 #define DW_WKUP_Pin GPIO_PIN_8
 #define DW_WKUP_GPIO_Port GPIOA
+#define DW_CTRL_Pin GPIO_PIN_12
+#define DW_CTRL_GPIO_Port GPIOA
 #define LED2_G_Pin GPIO_PIN_15
 #define LED2_G_GPIO_Port GPIOA
 #define LED2_R_Pin GPIO_PIN_3
@@ -91,7 +98,7 @@
 #define PWR_ON_Pin GPIO_PIN_7
 #define PWR_ON_GPIO_Port GPIOB
 /* USER CODE BEGIN Private defines */
-
+#define GET_IMUINT HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_0)
 /* USER CODE END Private defines */
 
 #ifdef __cplusplus

--
Gitblit v1.9.3