PIC24 Support Libraries
|
Go to the source code of this file.
Macros | |
#define | DELAY_MS(ms) delayAndUpdateHeartbeatCount(CYCLES_PER_MS * ((uint32_t) (ms))); |
#define | DELAY_US(us) delayAndUpdateHeartbeatCount(CYCLES_PER_US * ((uint32_t) (us))); |
Functions | |
static void | delayAndUpdateHeartbeatCount (uint32_t u32_cyc) |
Provides simple software delays. They are not cycle-accurate, however. These routines are integrated with a heartbeat LED, so the heartbeat count is updated during a delay.
Definition in file pic24_delay.h.
#define DELAY_MS | ( | ms | ) | delayAndUpdateHeartbeatCount(CYCLES_PER_MS * ((uint32_t) (ms))); |
A macro to delay the given number of milliseconds. The maximum delay is ~ 100+ seconds when FCY = 40 MHz, because the underlying function delayAndUpdateHeartbeatCount uses a uint32_t value for the number of processor clocks to delay.
ms | The number of milliseconds to delay. |
Definition at line 71 of file pic24_delay.h.
Referenced by configUART1().
#define DELAY_US | ( | us | ) | delayAndUpdateHeartbeatCount(CYCLES_PER_US * ((uint32_t) (us))); |
A macro to delay the given number of microseconds.
us | The number of microseconds to delay. |
Definition at line 77 of file pic24_delay.h.
|
inlinestatic |
Delay the given number of processor clock cycles, then notify the heartbeat that time passed. Scale the time added to the heartbeat because we are not incurring the same overhead as if we repeatedly called doHeartbeat()
.
u32_cyc | Number of processor clock cycles to delay. |
Definition at line 55 of file pic24_delay.h.