From 82e38738a4d532cc3d56cbf80c1a4093f23cdd6a Mon Sep 17 00:00:00 2001
From: tao_z <tzj0429@163.com>
Date: Wed, 14 Jul 2021 07:01:42 +0800
Subject: [PATCH] 调整时钟64MHz。 RTT任务增加马达开启和关闭功能

---
 USR/INC/pwm.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/USR/INC/pwm.h b/USR/INC/pwm.h
index da32571..5be01f7 100644
--- a/USR/INC/pwm.h
+++ b/USR/INC/pwm.h
@@ -1,11 +1,13 @@
 #ifndef _PWM_H_
 #define _PWM_H_
 #include "gd32e23x_timer.h"
-//100us * 30000 = 3s
+//1us * 30000 = 30ms
 #define PERIOD_CAP (30000U)
+#define SPEED_TIMEOUT (300U) //9S
 
-//48Mzhz / 3000 = 16Khz = 62.5us
-#define PERIOD_CMP (3000u)
+//64Mzhz / 3200 = 20Khz = 50us
+#define PERIOD_CMP (3200u)
+#define TIMER2_PERIOD (63U)
 
 void TimerInit(void);
 void SetPwmDuty(uint16_t ch, uint32_t duty);

--
Gitblit v1.8.0