• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /**
16  *  @defgroup linux Linux
17  *  @defgroup delay Delay
18  *  @ingroup linux
19  */
20 #ifndef _ASM_DELAY_H
21 #define _ASM_DELAY_H
22 
23 #include "los_typedef.h"
24 #include "los_tick.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29 
30 #ifndef udelay
31 /**
32  * @ingroup  delay
33  * @brief It is same with #LOS_Udelay.
34  * @par Dependency:
35  * <ul><li>los_tick.h: the header file that contains the API declaration.</li></ul>
36  */
37 #define udelay(n)   LOS_Udelay(n)
38 #endif
39 
40 #ifndef mdelay
41 /**
42  * @ingroup  delay
43  * @brief It is same with #LOS_Mdelay.
44  * @par Dependency:
45  * <ul><li>los_tick.h: the header file that contains the API declaration.</li></ul>
46  */
47 #define mdelay(n)   LOS_Mdelay(n)
48 #endif
49 
50 /**
51  * @ingroup delay
52  * @brief Delay current task.
53  *
54  * @par Description:
55  * <ul>
56  * <li>This API is used to delay current task.</li>
57  * </ul>
58  * @attention
59  * <ul>
60  * <li>The unit of param is millisecond, and the minimum is 1 tick.</li>
61  * <li>This API is not an accurate delay function. The actual delay time is longer than that of parameter msecs.</li>
62  * </ul>
63  *
64  * @param msecs     [IN] Type #unsigned int time to delay current task.
65  * @retval None.
66  * @par Dependency:
67  * <ul><li>delay.h: the header file that contains the API declaration.</li></ul>
68  * @see None.
69  * @since Huawei LiteOS V100R001C00
70  */
71 extern void msleep(unsigned int msecs);
72 
73 #ifdef __cplusplus
74 }
75 #endif /* __cplusplus */
76 
77 #endif
78