| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 32 | kaklik | #include "Compiler.h" |
| 2 | #include "timer.h" |
||
| 3 | #include "HardwareProfile.h" |
||
| 4 | |||
| 5 | #define __DELAY_C |
||
| 6 | |||
| 7 | #if defined(__C32__) |
||
| 8 | void DelayMs(WORD ms) |
||
| 9 | { |
||
| 10 | unsigned char i; |
||
| 11 | while(ms--) |
||
| 12 | { |
||
| 13 | i=4; |
||
| 14 | while(i--) |
||
| 15 | { |
||
| 16 | Delay10us(25); |
||
| 17 | } |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | void Delay10us(DWORD dwCount) |
||
| 22 | { |
||
| 23 | volatile DWORD _dcnt; |
||
| 24 | |||
| 25 | _dcnt = dwCount*((DWORD)(0.00001/(1.0/GetInstructionClock())/10)); |
||
| 26 | while(_dcnt--) |
||
| 27 | { |
||
| 28 | #if defined(__C32__) |
||
| 29 | Nop(); |
||
| 30 | Nop(); |
||
| 31 | Nop(); |
||
| 32 | #endif |
||
| 33 | } |
||
| 34 | } |
||
| 35 | #endif |
||
| 36 |
Powered by WebSVN v2.8.3