delay.c

00001 #include "delay.h"
00002  
00003 //----------------------------------------------------------------------------
00004 // Wait for a specific time in 100 uSec
00005 // (15 + t*( ((K_DELAY_100us-1)*6)+5 ))
00006 //----------------------------------------------------------------------------
00007 void Delay_100us(unsigned char t) {
00008   unsigned int i;
00009   if (t==0) return;
00010   while (t--) for(i=0;i<K_DELAY_100us; i++);
00011 }
00012 //----------------------------------------------------------------------------
00013 // Wait for a specific time in 1 mSec
00014 // (15 + t*( ((K_DELAY_1ms-1)*6)+5 ))
00015 //----------------------------------------------------------------------------
00016 void Delay_1ms(unsigned char t) {
00017   unsigned int i;
00018   if (t==0) return;
00019   while (t--) for(i=0;i<K_DELAY_1ms; i++);
00020 }
00021 //----------------------------------------------------------------------------
00022 // Wait for a specific time in 10 mSec
00023 // (15 + t*( ((K_DELAY_10ms-1)*6)+5 ))
00024 //----------------------------------------------------------------------------
00025 void Delay_10ms(unsigned char t) {
00026   unsigned int i;
00027   if (t==0) return;
00028   while (t--) for(i=0;i<K_DELAY_10ms; i++);
00029 }

Generated on Mon Apr 11 14:23:36 2011 for Contiki 2.5 by  doxygen 1.6.1