From 4a89e24804b91902def506a9e898293fa36ccb59 Mon Sep 17 00:00:00 2001
From: tao_z <tzj0429@163.com>
Date: Sat, 10 Jul 2021 11:52:25 +0800
Subject: [PATCH] 待调试电机转动

---
 USR/SRC/main.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/USR/SRC/main.c b/USR/SRC/main.c
index ef743d2..e8e0e54 100644
--- a/USR/SRC/main.c
+++ b/USR/SRC/main.c
@@ -1,19 +1,46 @@
 #include "gd32e23x.h"
 #include <stdio.h>
 #include "gpio.h"
+#include "adc.h"
 #include "pwm.h"
 #include "uart.h"
 #include "clock.h"
+#include "motor.h"
+#include "bldc_ctrl.h"
+#include "bsp_pid.h"
+#include "os_task.h"
+#include "RttTask.h"
+#include "SEGGER_RTT_Conf.h"
+#include "SEGGER_RTT.h"
+
+static void Comm_Task(void *p)
+{
+	// uint8_t step = 0;
+	// step = get_hall_state();
+	// SEGGER_RTT_printf(0, "Hall state is:%d!\n", step);
+}
 
 int main()
 {
+
+	OS_TASK_MSG task_queue[8] = {0};
+	InitOSTaskQueue(task_queue, 8);
+
 	Clock_Config();
 	GPIO_Init();
 	TimerInit();
 
 	UartInit();
 	ADC_Init();
+	Motor_Init();
+	bldcm_init();
+	PID_param_init();
+	RTT_TaskInit();
 	Ostick_config();
+
+	OSTaskCreate(&Comm_Task, 10, 7, NULL);
+	OSTaskCreate(&RTT_Task10ms, 1000, 7, NULL);
+	OSSchedule(&OS_GetTick);
 	while (1)
 		;
 	return 0;

--
Gitblit v1.8.0