Is utils/atomic.h available for EPS8266?

I have some code that works fine on my UNO with ethernet shield. I’m trying to update the installation to use a NodeMCU v3 clone that utilizes the EPS8266 Wemos board. In order to use this module, I updated from Arduino 1.6.1 to 1.6.7. The code still compiles for the UNO but when I try switching the board type to “NodeMCU 1.0 (EPS-12E module)” I get the following error:

Build options changed, rebuilding all
C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:3:25: fatal error: util/atomic.h: No such file or directory

 #include <util/atomic.h>

                         ^

compilation terminated.

exit status 1
Error compiling.

I switched back to UNO and compiled again successfully, so this is clearly an issue with the selected board. Does the EPS8266 work with the atomic.h library or is that a different version I should locate? I’m brand new to the EPS8266 (delivered yesterday), so I am not sure yet if there’s a better location to ask these Arduino IDE questions to other than here.

so I am not sure yet if there's a better location to ask these Arduino IDE questions to other than here.

The problem isn't with the IDE. The problem is with either the core files delivered for the ESP thing OR with the sample code delivered with some library.

Why do you think you need to include atomic.h?

The code I'm trying to use on the NodeMCU is a 433MHz RF receiver/decoder for several systems (Blueline power meter reader, Acurite weather station, Acurite temperature sensor).

The code base was sourced from various projects and combined such that a single Arduino Uno could collect data and send it to a MQTT broker on my RPi via an Ethernet shield. The original project started with the power meter reader and the two projects I based my code on both used atomic.h. If there is another approach rather than using this library, then I could go that route. I'm currently using the "ATOMIC_BLOCK(ATOMIC_FORCEON)" statement to set interrupts so nothing breaks in while recording the pulse length.

    ATOMIC_BLOCK(ATOMIC_FORCEON)
    {
      p = pulse;
      pulse = 0;
    }

Maybe there's a better way in which case I can eliminate using the atomic.h library.

Maybe there's a better way in which case I can eliminate using the atomic.h library.

Look at the library. What, exactly, does the ATOMIC_BLOCK() "function" do? I'm guessing that all it does is disable interrupts while some data is copied, and then re-enable them.

I guess I could just use the interrupts call instead.

     noInterrupts();
      p = pulse;
      pulse = 0;
      interrupts();

I made the change from atomic.h to using noInterrupts() and interrupts(). Compiling with both UNO and NodeMCU gives no error for that code now. However, the compiler for NodeMCU does not like many other lines of code. Is this forum the best place to ask for help with these errors or should I direct questions to the ESP8266 forum (or somewhere else) instead? For reference, these are the errors that I’ve already started working through:

Build options changed, rebuilding all
In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:13:0:

sketch\Acurite592TX.h:103:0: warning: "MAXBITS" redefined [enabled by default]

 #define MAXBITS         112

 ^

In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:12:0:

sketch\Acurite5n1.h:20:0: note: this is the location of the previous definition

 #define MAXBITS      64  // max framesize

 ^

In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:10:0:

sketch\DecodeOOK.h: In member function 'bool DecodeOOK::nextPulse(word)':

sketch\DecodeOOK.h:18:23: warning: case label value is less than minimum value for type [enabled by default]

                 case -1: resetDecoder(); break;

                       ^

In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:11:0:

sketch\Blueline.h: In member function 'bool Blueline::nextPulse(word)':

sketch\Blueline.h:149:23: warning: case label value is less than minimum value for type [enabled by default]

                 case -1: resetDecoder(); break;

                       ^

In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:12:0:

sketch\Acurite5n1.h: In member function 'bool Acurite5n1::nextPulse(word)':

sketch\Acurite5n1.h:124:23: warning: case label value is less than minimum value for type [enabled by default]

                 case -1: 

                       ^

In file included from C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino:13:0:

sketch\Acurite592TX.h: In member function 'bool Acurite592TX::nextPulse(word)':

sketch\Acurite592TX.h:206:23: warning: case label value is less than minimum value for type [enabled by default]

                 case -1: 

                       ^

C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino: At global scope:

ookDecoder-ben9:52: error: expected constructor, destructor, or type conversion before '(' token

 ISR(VECT) {

     ^

ookDecoder-ben9:52: error: expected constructor, destructor, or type conversion before '(' token

 ISR(VECT) {

    ^

C:\Users\Ben\Documents\Arduino\ookDecoder-ben\ookDecoder-ben9\ookDecoder-ben9.ino: In function 'void setupPinChangeInterrupt()':

ookDecoder-ben9:66: error: 'PCMSK2' was not declared in this scope

   PCMSK2 = bit(DPIN_OOK_RX);

   ^

In file included from sketch\ookDecoder-ben9.ino.cpp:1:0:

ookDecoder-ben9:67: error: 'PCICR' was not declared in this scope

   bitSet(PCICR, PCIE2);

          ^

C:\Users\Ben\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Arduino.h:172:30: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                              ^

ookDecoder-ben9:67: error: 'PCIE2' was not declared in this scope

   bitSet(PCICR, PCIE2);

                 ^

C:\Users\Ben\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.0.0\cores\esp8266/Arduino.h:172:49: note: in definition of macro 'bitSet'

 #define bitSet(value, bit) ((value) |= (1UL << (bit)))

                                                 ^

exit status 1
expected constructor, destructor, or type conversion before '(' token

And, for reference, none of these errors exist when compiling with UNO:

Build options changed, rebuilding all

Sketch uses 25,326 bytes (78%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,576 bytes (76%) of dynamic memory, leaving 472 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur.