ct_test/Keil_C/User/main.c

59 lines
1.6 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//************************************************************
// Copyright (c)
// FileName : main.c
// Module Function :
// Instructions : Contains the MCU initialization function and its H file
//************************************************************
/********************Includes************************************************************************/
#include "SC_Init.h" //MCU Init headerInclude all IC resource headers
#include "SC_it.h"
#include "..\Drivers\SCDriver_list.h"
#include "HeadFiles\SysFunVarDefine.h"
#include <SC92F836xB_C.H>
#include "test.h"
#include "uart1.h"
#include "motor.h"
#include "adc.h"
/**************************************Generated by EasyCodeCube*************************************/
/*************************************.Generated by EasyCodeCube.************************************/
/*****************************************************************************************************
* Function Name: main
* Description : This function implements main function.
* Arguments : None
* Return Value : None
******************************************************************************************************/
void main(void)
{
SC_Init(); /*** MCU init***/
InitUart_Data();//串口数据初始化
/*****MainLoop*****/
while(1)
{
/*<UserCodeStart>*//*<SinOne-Tag><5>*/
//数据接收分析(放置大循环内)
Deal_Uart_Data_For_Module();
//处理电机运行各种模式
Deal_Motor();//一般采用1-5毫秒
//采集ADC数据
if(it_10ms_flag == 1)//10毫秒
{
it_10ms_flag = 0;
ADC_Multichannel();//ADC数据采集
}
//运行指示灯
led_test();
}
}