forked from nceruchalu/easypay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delay.h
41 lines (34 loc) · 1.2 KB
/
delay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* -----------------------------------------------------------------------------
* ----- DELAY.H -----
* ----- EASYPAY -----
* -----------------------------------------------------------------------------
*
* File Description:
* This is the header file of time delay routines for EasyPay.
* Purposely named delay.h so as to not conflict with system library, delays.h
*
* Assumptions:
* None
*
* Compiler:
* HI-TECH C Compiler for PIC18 MCUs (http://www.htsoft.com/)
*
* Revision History:
* Apr. 25, 2012 Nnoduka Eruchalu Initial Revision
*/
#ifndef DELAY_H
#define DELAY_H
/* library include files */
#include <htc.h> /* for __delay_ms */
/*
* __delay_s(x)
* max number of __delay_ms is 40ms
* so each second requires 25 loops of __delay_ms(40)
*/
#define __delay_s(x) \
do { \
unsigned long n; \
for(n=0; n < (unsigned long) 25*x; n++) {__delay_ms(40);} \
} while(0)
#endif /* DELAY_H */