Skip to content

Commit 5f9db70

Browse files
committed
Replace #define yield() _NOP() with inline void yield() { _NOP(); } so that other code can define a yield() function.
1 parent 84d7ad4 commit 5f9db70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cpp/arduino/Arduino.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ typedef uint8_t byte;
3636
#define highByte(w) ((uint8_t) ((w) >> 8))
3737
#define lowByte(w) ((uint8_t) ((w) & 0xff))
3838

39-
// might as well use that NO-op macro for these, while unit testing
40-
// you need interrupts? interrupt yourself
41-
#define yield() _NOP()
42-
#define interrupts() _NOP()
43-
#define noInterrupts() _NOP()
39+
// using #define for these makes it impossible for other code to use as function
40+
// names!
41+
inline void yield() { _NOP(); }
42+
inline void interrupts() { _NOP(); }
43+
inline void noInterrupts() { _NOP(); }
4444

4545
// TODO: correctly establish this per-board!
4646
#define F_CPU 1000000UL

0 commit comments

Comments
 (0)