# Particle Dev Compile time access to type of device?

**URL:** <https://community.particle.io/t/particle-dev-compile-time-access-to-type-of-device/15160>\
**Category:** Firmware\
**Created:** [September 6, 2015, 1:17pm UTC](https://community.particle.io/t/particle-dev-compile-time-access-to-type-of-device/15160 "2015-09-06T13:17:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phec](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/phec/32/8303_2.png) [@phec](https://community.particle.io/u/phec)\
**Post date:** [September 6, 2015, 1:17pm UTC](https://community.particle.io/t/particle-dev-compile-time-access-to-type-of-device/15160/1 "2015-09-06T13:17:24Z")

</div>

I’m enjoying the nice tight compose-edit-compile-flash cycle I get with the Photon and Particle Dev. I no longer bother with local compilation which avoids all sorts of version control issues. Thank you.

Some of my code is device dependent, for example:

```cpp
#ifdef PHOTON
    setADCSampleTime(ADC_SampleTime_112Cycles); // Photon specific code
#endif

```

It isn’t a big issue but as the compiler obviously knows whether the target is Core or Spark, is there a system defined variable that I can use instead of adding my own `#define PHOTON` ?  
I appreciate it isn’t as important as the bug fixes the clever Particle guys are working on but maybe it is already done and I just haven’t found it.

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [September 6, 2015, 3:29pm UTC](https://community.particle.io/t/particle-dev-compile-time-access-to-type-of-device/15160/2 "2015-09-06T15:29:39Z")

</div>

I think you can try something like:

```auto
#if PLATFORM_ID==6
//blah blash
#endif

```

---

<div class="post-metadata">

**Author:** ![phec](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/phec/32/8303_2.png) [@phec](https://community.particle.io/u/phec)\
**Post date:** [September 6, 2015, 5:21pm UTC](https://community.particle.io/t/particle-dev-compile-time-access-to-type-of-device/15160/3 "2015-09-06T17:21:40Z")

</div>

That works @kennethlimcp! Now I only need one version of my software. Thank you.
