Rev 107 | Rev 413 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 107 | Rev 404 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | * |
36 | * |
37 | * Delay the execution for the given number |
37 | * Delay the execution for the given number |
38 | * of microseconds (or slightly more). The delay |
38 | * of microseconds (or slightly more). The delay |
39 | * is implemented as CPU calibrated active loop. |
39 | * is implemented as CPU calibrated active loop. |
40 | * |
40 | * |
41 | * @param microseconds Number of usec to sleep. |
41 | * @param usec Number of microseconds to sleep. |
42 | * |
- | |
43 | */ |
42 | */ |
44 | void delay(__u32 microseconds) |
43 | void delay(__u32 usec) |
45 | { |
44 | { |
46 | pri_t pri; |
45 | pri_t pri; |
47 | 46 | ||
48 | /* The delay loop is calibrated for each and every |
47 | /* The delay loop is calibrated for each and every |
49 | CPU in the system. Therefore it is necessary to |
48 | CPU in the system. Therefore it is necessary to |
50 | cpu_priority_high() before calling the asm_delay_loop(). */ |
49 | cpu_priority_high() before calling the asm_delay_loop(). */ |
51 | pri = cpu_priority_high(); |
50 | pri = cpu_priority_high(); |
52 | asm_delay_loop(microseconds * CPU->delay_loop_const); |
51 | asm_delay_loop(usec * CPU->delay_loop_const); |
53 | cpu_priority_restore(pri); |
52 | cpu_priority_restore(pri); |
54 | } |
53 | } |