|
|
|
|
#ifndef __DELAY_H
|
|
|
|
|
#define __DELAY_H
|
|
|
|
|
#include "sys.h"
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><EFBFBD>ѧϰʹ<EFBFBD>ã<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD>;
|
|
|
|
|
//ALIENTEK STM32<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//ʹ<EFBFBD><EFBFBD>SysTick<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD>ӳٽ<EFBFBD><EFBFBD>й<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʺ<EFBFBD>STM32F10xϵ<EFBFBD>У<EFBFBD>
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>delay_us,delay_ms
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD>@ALIENTEK
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳:www.openedv.com
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:2010/1/1
|
|
|
|
|
//<EFBFBD>汾<EFBFBD><EFBFBD>V1.8
|
|
|
|
|
//<EFBFBD><EFBFBD>Ȩ<EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//Copyright(C) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿƼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˾ 2009-2019
|
|
|
|
|
//All rights reserved
|
|
|
|
|
//********************************************************************************
|
|
|
|
|
//V1.2<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//<EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ȷ,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>do while<EFBFBD>ṹ!
|
|
|
|
|
//V1.3<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD>
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD>UCOSII<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>.
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>ucosII,delay_init<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SYSTICK<EFBFBD><EFBFBD>ֵ,ʹ֮<EFBFBD><EFBFBD>ucos<EFBFBD><EFBFBD>TICKS_PER_SEC<EFBFBD><EFBFBD>Ӧ.
|
|
|
|
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FBFBD><EFBFBD>֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>OS(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UCOSII<EFBFBD><EFBFBD>UCOSIII,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>OS<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>)
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:delay_osrunning/delay_ostickspersec/delay_osintnesting<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>궨<EFBFBD><EFBFBD>
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:delay_osschedlock/delay_osschedunlock/delay_ostimedly<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//V1.8<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD> 20150519
|
|
|
|
|
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD>UCOSIII֧<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>bug<EFBFBD><EFBFBD>
|
|
|
|
|
//delay_tickspersec<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>delay_ostickspersec
|
|
|
|
|
//delay_intnesting<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>delay_osintnesting
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
void delay_init(void);
|
|
|
|
|
void delay_ms(u16 nms);
|
|
|
|
|
void delay_us(u32 nus);
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|