-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhal_delay.c
More file actions
executable file
·60 lines (54 loc) · 1.21 KB
/
hal_delay.c
File metadata and controls
executable file
·60 lines (54 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRENTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
* $LastChangedRevision: 133 $
*/
/** @file
* @brief delay routine which is more or less exact within + - 2us.
* @defgroup hal_nrf24le1_hal_delay Delay routine
* @{
* @ingroup hal_nrf24le1
*
*
* Delay routine which accesses registers directly.
*
*/
#include "hal_delay.h"
#include "memdefs.h"
//#include <stdint.h>
//#include "assertions.h"
#ifdef __C51__
#include <intrins.h>
#elif __ICC8051__
#include <intrinsics.h>
#warning Not tested properly for IAR.
#endif
void delay_us(uint16_t us)
{
do
{
_nop_();
_nop_();
_nop_();
_nop_();
_nop_();
} while (--us);
}
void delay_ms(uint16_t ms)
{
do
{
delay_us(250);
delay_us(250);
delay_us(250);
delay_us(250);
} while (--ms);
}
/** @} */