PlatformIO Community

D1_mini vs d1_mini_lite board. How to support both in one build?

Hi all,
my firmware runs great on d1_mini_lite board since 1MB of flash is more than enough.

How can I create a build for both D1 mini and D1 mini lite?

Suppose that in my platformio.ini file I use the
d1_mini_lite board,
will the produced firmware runs great on d1_mini or there may be some problems?

Thanks!

I don’t know your specific boards, but based on an Arduino Uno, for example, I can initialise a new project with an Uno board then add a Nano and a Duemilanove as all three use the ATmega328 microcontroller.

This allows me to write code, either using the Arduino framework, or plain AVR C++, which I can build and upload for one of the three boards, without having to change the code.

However, lets say I add a board, still an AVR, but which has slightly different registers, maybe using an ATtiny85. Now I can’t use the same source code in AVR C++ as the latter device uses a different microcontroller.

I would have to scatter this sort of thing through my code:

#ifdef REGISTER_NAME_IN_ATMEGA328
    // Code for ATmega328 boards.
#else
    // Code for ATtiny85.
#endif.

Using the Arduino framework, with the core files for the ATtiny installed, doesnt need this as the core files have it built in. However, the ATtiny doesn’t have Serial like the ATmega328, so it can’t be used on all boards in the project.

So, what you ask could be done, but it’s not necessarily straight forward.

HTH

Cheers,
Norm.