Skip to content

Commit b5a5e67

Browse files
Added missing API functions microsecondsToClockCycles etc
1 parent 2c25a5f commit b5a5e67

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

STM32F1/cores/maple/wirish.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,10 @@ typedef unsigned int word;
9898
#ifndef _BV
9999
#define _BV(bit) (1 << (bit))
100100
#endif
101+
102+
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
103+
#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (F_CPU / 1000L) )
104+
#define microsecondsToClockCycles(a) ( (a) * (F_CPU / 1000000L) )
105+
101106
#endif
102107

0 commit comments

Comments
 (0)