• Main Page
  • Modules
  • Index
  • File List
  • Globals

hal/hal_delay.c

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  * $LastChangedRevision: 133 $
00012  */
00013 
00025 #include "hal_delay.h"
00026 #include "memdefs.h"
00027 //#include <stdint.h>
00028 //#include "assertions.h"
00029 
00030 #ifdef __C51__
00031 #include <intrins.h>
00032 #elif __ICC8051__
00033 #include <intrinsics.h>
00034 #warning Not tested properly for IAR.
00035 #endif
00036 
00037 void delay_us(uint16_t us)
00038 {
00039   do
00040   {
00041     _nop_();
00042     _nop_();
00043     _nop_();
00044     _nop_();
00045     _nop_();
00046   } while (--us);
00047 }
00048 
00049 void delay_ms(uint16_t ms)
00050 {
00051   do
00052   {
00053     delay_us(250);
00054     delay_us(250);
00055     delay_us(250);
00056     delay_us(250);
00057   } while (--ms);
00058 }
00059 

Generated on Fri Apr 20 2012 14:11:44 for nRFGo SDK by  doxygen 1.7.2