68 lines
1.4 KiB
C
68 lines
1.4 KiB
C
|
#ifndef __DELAY_H
|
|||
|
#define __DELAY_H
|
|||
|
#include "sys.h"
|
|||
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѧϰʹ<CFB0>ã<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD>;
|
|||
|
//ALIENTEK STM32<33><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//ʹ<><CAB9>SysTick<63><6B><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>ģʽ<C4A3><CABD><EFBFBD>ӳٽ<D3B3><D9BD>й<EFBFBD><D0B9><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD>delay_us,delay_ms
|
|||
|
//<2F><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>@ALIENTEK
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳:www.openedv.com
|
|||
|
//<2F><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD>:2012/9/2
|
|||
|
//<2F>汾<EFBFBD><E6B1BE>V1.5
|
|||
|
//<2F><>Ȩ<EFBFBD><C8A8><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
|||
|
//Copyright(C) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<D3BF><C6BC><EFBFBD><EFBFBD><EFBFBD>˾ 2009-2019
|
|||
|
//All rights reserved
|
|||
|
//********************************************************************************
|
|||
|
//V1.2<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><D0B6>е<EFBFBD><D0B5>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>
|
|||
|
//<2F><>ֹ<EFBFBD><D6B9>ʱ<EFBFBD><CAB1>ȷ,<2C><><EFBFBD><EFBFBD>do while<6C>ṹ!
|
|||
|
|
|||
|
//V1.3<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>UCOSII<49><49>ʱ<EFBFBD><CAB1>֧<EFBFBD><D6A7>.
|
|||
|
//<2F><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>ucosII,delay_init<69><74><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>SYSTICK<43><4B>ֵ,ʹ֮<CAB9><D6AE>ucos<6F><73>TICKS_PER_SEC<45><43>Ӧ.
|
|||
|
//delay_ms<6D><73>delay_usҲ<73><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ucos<6F>ĸ<EFBFBD><C4B8><EFBFBD>.
|
|||
|
//delay_us<75><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ucos<6F><73>ʹ<EFBFBD><CAB9>,<2C><><EFBFBD><EFBFBD>ȷ<D7BC>Ⱥܸ<C8BA>,<2C><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ռ<EFBFBD>ö<EFBFBD><C3B6><EFBFBD><EFBFBD>Ķ<EFBFBD>ʱ<EFBFBD><CAB1>.
|
|||
|
//delay_ms<6D><73>ucos<6F><73>,<2C><><EFBFBD>Ե<EFBFBD><D4B5><EFBFBD>OSTimeDly<6C><79><EFBFBD><EFBFBD>,<2C><>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>ucosʱ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>delay_usʵ<73><CAB5>,<2C>Ӷ<EFBFBD>ȷ<D7BC><C8B7>ʱ
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ucos֮<73><D6AE>delay_ms<6D><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>,ѡ<><D1A1>OSTimeDlyʵ<79>ֻ<EFBFBD><D6BB><EFBFBD>delay_usʵ<73><CAB5>.
|
|||
|
|
|||
|
//V1.4<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD> 20110929
|
|||
|
//<2F><EFBFBD><DEB8><EFBFBD>ʹ<EFBFBD><CAB9>ucos,<2C><><EFBFBD><EFBFBD>ucosδ<73><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>,delay_ms<6D><73><EFBFBD>ж<EFBFBD><D0B6><EFBFBD><DEB7><EFBFBD>Ӧ<EFBFBD><D3A6>bug.
|
|||
|
//V1.5<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD> 20120902
|
|||
|
//<2F><>delay_us<75><73><EFBFBD><EFBFBD>ucos<6F><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD>ucos<6F><73><EFBFBD><EFBFBD>delay_us<75><73>ִ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>ܵ<EFBFBD><DCB5>µ<EFBFBD><C2B5><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><D7BC>
|
|||
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
void delay_init(void);
|
|||
|
void delay_ms(u16 nms);
|
|||
|
void delay_us(u32 nus);
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|