user29986: I am doing some work for both Arduino Mini Pro and for a NodeMCU style ESP8266 board. Within the Arduino IDE I tell it what board I am compiling for and downloading to.
How do I access which board in my scripts? 
Some sections are for one or the other exclusively. Right now I'm using a #define at top of the script, but changing this to switch between boards not the best. For example, version control keeps on thinking I'm in a new branch when I'm not.

user26916: There are a number of macros defined to help you with this:

__AVR__ for any board with AVR architecture.
ARDUINO_AVR_PRO for the Arduino Pro or Pro Mini selection in the Tools > Board menu.
ESP8266 for any ESP8266 board.
ARDUINO_ESP8266_NODEMCU for the NodeMCU 0.9 (ESP-12 Module) or NodeMCU 1.0 (ESP-12E Module) selections in the Tools > Board menu.

This allows you to do things like this:
#if defined(__AVR__)
// AVR specific code here
#elif defined(ESP8266)
// ESP8266 specific code here
#endif


29986: <p>I am doing some work for both Arduino Mini Pro and for a NodeMCU style ESP8266 board. Within the Arduino IDE I tell it what board I am compiling for and downloading to.</p>

<p>How do I access which board in my scripts? </p>

<p>Some sections are for one or the other exclusively. Right now I'm using a <code>#define</code> at top of the script, but changing this to switch between boards not the best. For example, version control keeps on thinking I'm in a new branch when I'm not.</p>
 26916: <p>There are a number of macros defined to help you with this:</p>

<ul>
<li><code>__AVR__</code> for any board with AVR architecture.</li>
<li><code>ARDUINO_AVR_PRO</code> for the <strong>Arduino Pro or Pro Mini</strong> selection in the <strong>Tools > Board</strong> menu.</li>
<li><code>ESP8266</code> for any ESP8266 board.</li>
<li><code>ARDUINO_ESP8266_NODEMCU</code> for the <strong>NodeMCU 0.9 (ESP-12 Module)</strong> or <strong>NodeMCU 1.0 (ESP-12E Module)</strong> selections in the <strong>Tools > Board</strong> menu.</li>
</ul>

<p>This allows you to do things like this:</p>

<pre class="lang-cpp prettyprint-override"><code>#if defined(__AVR__)
// AVR specific code here
#elif defined(ESP8266)
// ESP8266 specific code here
#endif
</code></pre>
