fix:修复调光时间BUG
解决调光时间一样的情况下,调光亮与调光灭的实际调光时间不一致问题
This commit is contained in:
47
timer.h
Normal file
47
timer.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* --- STC MCU Limited ------------------------------------------------*/
|
||||
/* --- STC 1T Series MCU Demo Programme -------------------------------*/
|
||||
/* --- Mobile: (86)13922805190 ----------------------------------------*/
|
||||
/* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/
|
||||
/* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/
|
||||
/* --- Web: www.STCMCU.com --------------------------------------------*/
|
||||
/* --- Web: www.STCMCUDATA.com ---------------------------------------*/
|
||||
/* --- QQ: 800003751 -------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ô˴<C3B4><CBB4><EFBFBD>,<2C><><EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD>STC<54><43><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __TIMER_H
|
||||
#define __TIMER_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define Timer0 0
|
||||
#define Timer1 1
|
||||
#define Timer2 2
|
||||
#define Timer3 3
|
||||
#define Timer4 4
|
||||
|
||||
#define TIM_16BitAutoReload 0
|
||||
#define TIM_16Bit 1
|
||||
#define TIM_8BitAutoReload 2
|
||||
#define TIM_16BitAutoReloadNoMask 3
|
||||
|
||||
#define TIM_CLOCK_1T 0
|
||||
#define TIM_CLOCK_12T 1
|
||||
#define TIM_CLOCK_Ext 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 TIM_Mode; //<2F><><EFBFBD><EFBFBD>ģʽ, TIM_16BitAutoReload,TIM_16Bit,TIM_8BitAutoReload,TIM_16BitAutoReloadNoMask
|
||||
u8 TIM_Priority; //<2F><><EFBFBD>ȼ<EFBFBD><C8BC><EFBFBD><EFBFBD><EFBFBD> Priority_0,Priority_1,Priority_2,Priority_3
|
||||
u8 TIM_Interrupt; //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD> ENABLE,DISABLE
|
||||
u8 TIM_ClkSource; //ʱ<><CAB1>Դ TIM_CLOCK_1T,TIM_CLOCK_12T,TIM_CLOCK_Ext
|
||||
u8 TIM_ClkOut; //<2F>ɱ<EFBFBD><C9B1><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ENABLE,DISABLE
|
||||
u16 TIM_Value; //װ<>س<EFBFBD>ֵ
|
||||
u8 TIM_Run; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD> ENABLE,DISABLE
|
||||
} TIM_InitTypeDef;
|
||||
|
||||
extern u32 systick_1ms;
|
||||
u8 Timer_Inilize(u8 TIM, TIM_InitTypeDef *TIMx);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user