提交 | 用户 | age | ||
076cda | 1 | #include "delay.h" |
Q | 2 | #include <stdint.h> |
3 | #include "stm32f0xx_hal.h" | |
4 | ||
5 | void Delay_Us (uint32_t delay) | |
6 | { | |
7 | uint8_t i=0; | |
8 | uint32_t j=0; | |
9 | for(i=0;i<delay;i++) | |
10 | { | |
11 | for(j=0;j<8;j++); | |
12 | } | |
13 | } | |
14 | ||
15 | ||
16 | void Delay_Ms(uint32_t delay ) | |
17 | { | |
18 | uint32_t i=0; | |
19 | uint32_t j=0; | |
20 | ||
21 | for(i=0;i<delay;i++) | |
22 | { | |
23 | for(j=0;j<4540;j++); | |
24 | } | |
25 | } | |
26 | ||
27 | void HAL_Delay_nMS( uint32_t Delay ) | |
28 | { | |
29 | HAL_Delay(Delay); | |
30 | ||
31 | } | |
32 |