GeBalanceBot/GeBalanceBot_Firmware v1.0 .../DRV/bsp_sys.c

42 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/******************** (C) COPYRIGHT 2023 GeekRebot *****************************
* File Name : bsp_sys.c
* Current Version : V1.0 & ST 3.5.0
* Author : zhanli 719901725@qq.com
* Date of Issued : 2023.04.06 zhanli: Create
* Comments : <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
********************************************************************************/
#include "bsp_sys.h"
/**----------------------------------------------------------------------
* Function : System_Init
* Description : GeekRebot
* Author : zhanli&719901725@qq.com
* Date : 2023/04/22 zhanli
*---------------------------------------------------------------------**/
void System_Init(void)
{
Delay_Init(72);
NVIC_Config();
LED_GPIO_Config();
USART1_Init(115200);
//IIC_Init();
Motor_Init();
MOTO_PWM_Init(3599,0);
Encoder_Init_TIM2();
TIM2 -> CNT=30000;
Encoder_Init_TIM4();
TIM4 -> CNT=30000;
Motor_PWMOut(100, 100);
int Moto_Left=500;
int Moto_Right=500;
TIM3->CCR3 = Moto_Left;
TIM3->CCR4 = Moto_Right;
}