Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /********************************************************************* |
2 | * |
||
3 | * Timer |
||
4 | * |
||
5 | ********************************************************************* |
||
6 | * FileName: timer.h |
||
7 | * Processor: PIC24 / Daytona |
||
8 | * Complier: MPLAB C30/C32 |
||
9 | * |
||
10 | * Company: Microchip Technology, Inc. |
||
11 | * |
||
12 | * Software License Agreement: |
||
13 | * |
||
14 | * The software supplied herewith by Microchip Technology Incorporated |
||
15 | * (the Company) for its dsPIC30F and PICmicro® Microcontroller is intended |
||
16 | * and supplied to you, the Companys customer, for use solely and |
||
17 | * exclusively on Microchip's dsPIC30F and PICmicro Microcontroller products. |
||
18 | * The software is owned by the Company and/or its supplier, and is |
||
19 | * protected under applicable copyright laws. All rights are reserved. |
||
20 | * Any use in violation of the foregoing restrictions may subject the |
||
21 | * user to criminal sanctions under applicable laws, as well as to |
||
22 | * civil liability for the breach of the terms and conditions of this |
||
23 | * license. |
||
24 | * |
||
25 | * THIS SOFTWARE IS PROVIDED IN AN AS IS CONDITION. NO WARRANTIES, |
||
26 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED |
||
27 | * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
||
28 | * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, |
||
29 | * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR |
||
30 | * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
||
31 | * |
||
32 | * Author Date Comment |
||
33 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
34 | * |
||
35 | * |
||
36 | ********************************************************************/ |
||
37 | |||
38 | #ifndef _MS_TIMER_HEADER_FILE |
||
39 | #define _MS_TIMER_HEADER_FILE |
||
40 | |||
41 | #ifndef __GENERIC_TYPE_DEFS_H_ |
||
42 | #include "GenericTypeDefs.h" |
||
43 | #endif |
||
44 | |||
45 | #if defined(__C30__) |
||
46 | #define Delay10us(x) \ |
||
47 | { \ |
||
48 | unsigned long _dcnt; \ |
||
49 | _dcnt=x*((unsigned long)(0.00001/(1.0/GetInstructionClock())/6)); \ |
||
50 | while(_dcnt--); \ |
||
51 | } |
||
52 | |||
53 | #define DelayMs(x) \ |
||
54 | { \ |
||
55 | unsigned long _dcnt; \ |
||
56 | unsigned long _ms; \ |
||
57 | _ms = x; \ |
||
58 | while (_ms) \ |
||
59 | { \ |
||
60 | _dcnt=((unsigned long)(0.001/(1.0/GetInstructionClock())/6)); \ |
||
61 | while(_dcnt--); \ |
||
62 | _ms--; \ |
||
63 | } \ |
||
64 | } |
||
65 | #elif defined(__PIC32MX__) |
||
66 | void Delay10us(DWORD dwCount); |
||
67 | void DelayMs(WORD ms); |
||
68 | #endif |
||
69 | |||
70 | |||
71 | #endif |
Powered by WebSVN v2.8.3