Skip to content

Commit

Permalink
Add defs for compatibility (#142)
Browse files Browse the repository at this point in the history
Add definitions for compatibility to many platforms and libraries
- clockCyclesPerMicrosecond()
- clockCyclesToMicroseconds(a)
- microsecondsToClockCycles(a)
  • Loading branch information
khoih-prog committed May 17, 2021
1 parent b504fea commit 7dc0aa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cores/rp2040/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
extern "C"{
#endif // __cplusplus

// For compatibility to many platforms and libraries
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )

// Disable/reenable all interrupts. Safely handles nested disables
void interrupts();
void noInterrupts();
Expand Down

0 comments on commit 7dc0aa1

Please sign in to comment.