Inject Board Name into Code

I wanted to share something I did a little differently. Since stringification is a thing when using these macros, I picked up a little macro goodness somewhere (I do not remember where):

#define stringify(s) _stringifyDo(s)
#define _stringifyDo(s) #s

Then I can just stringify(MACRO_NAME) and I’m golden. Using that, my script is:

Import("env")

env.Append(CPPDEFINES=[
  ("PLATFORMIO_BOARD", env["BOARD"])
])