Skip to content

Commit 630591b

Browse files
committed
Fix location of _NOP definition
1 parent f168ba3 commit 630591b

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3030
- Warnings about directory name mismatches are now based on proper comparison of strings
3131
- Now using the recommended "stable" URL for the `esp32` board family
3232
- `esp8266:huzzah` options updated as per upstream
33+
- Errors about `'_NOP' was not declared in this scope` (test added)
3334

3435
### Security
3536

SampleProjects/TestSomething/test/godmode.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ unittest(shift_out) {
282282

283283
}
284284

285+
unittest(no_ops) {
286+
pinMode();
287+
analogReference();
288+
analogReadResolution();
289+
analogWriteResolution();
290+
}
285291

286292
#ifdef HAVE_HWSERIAL0
287293

cpp/arduino/Arduino.h

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

39-
// Arduino defines this
40-
#define _NOP() do { 0; } while (0)
41-
4239
// might as well use that NO-op macro for these, while unit testing
4340
// you need interrupts? interrupt yourself
4441
#define yield() _NOP()
@@ -70,5 +67,3 @@ inline unsigned int makeWord(unsigned int w) { return w; }
7067
inline unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }
7168

7269
#define word(...) makeWord(__VA_ARGS__)
73-
74-

cpp/arduino/ArduinoDefines.h

+3
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,6 @@
9292
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
9393
#define LED_BUILTIN 13
9494
#endif
95+
96+
// Arduino defines this
97+
#define _NOP() do { 0; } while (0)

0 commit comments

Comments
 (0)