Contiki 2.5
delay.c
1 #include "delay.h"
2 
3 //----------------------------------------------------------------------------
4 // Wait for a specific time in 100 uSec
5 // (15 + t*( ((K_DELAY_100us-1)*6)+5 ))
6 //----------------------------------------------------------------------------
7 void Delay_100us(unsigned char t) {
8  unsigned int i;
9  if (t==0) return;
10  while (t--) for(i=0;i<K_DELAY_100us; i++);
11 }
12 //----------------------------------------------------------------------------
13 // Wait for a specific time in 1 mSec
14 // (15 + t*( ((K_DELAY_1ms-1)*6)+5 ))
15 //----------------------------------------------------------------------------
16 void Delay_1ms(unsigned char t) {
17  unsigned int i;
18  if (t==0) return;
19  while (t--) for(i=0;i<K_DELAY_1ms; i++);
20 }
21 //----------------------------------------------------------------------------
22 // Wait for a specific time in 10 mSec
23 // (15 + t*( ((K_DELAY_10ms-1)*6)+5 ))
24 //----------------------------------------------------------------------------
25 void Delay_10ms(unsigned char t) {
26  unsigned int i;
27  if (t==0) return;
28  while (t--) for(i=0;i<K_DELAY_10ms; i++);
29 }