RasPiArduino icon indicating copy to clipboard operation
RasPiArduino copied to clipboard

Choose compile time symbolic for the "PiDuino" board

Open nkolban opened this issue 9 years ago • 0 comments
trafficstars

From the Arduino IDE perspective, the Pi appears as a new board type. When a sketch is being compiled the sketch can make reference to the "type" of board it is being compiled for. An example of this can be see here in the popular "firmata" project:

https://github.com/firmata/arduino/blob/master/Boards.h

In there, we find the existence of some boards by name. These include:

  • __AVR_ATmega168__
  • __AVR_ATmega328P__
  • __AVR_ATmega328__
  • __AVR_ATmega8__
  • __AVR_ATmega1280__
  • __AVR_ATmega2560__
  • __SAM3X8E__
  • ARDUINO_SAMD_MKR1000
  • _VARIANT_ARDUINO_ZERO_
  • _VARIANT_ARDUINO_101_X_
  • __AVR_AT90USB162__
  • ARDUINO_LINUX
  • __AVR_ATmega644P__
  • __AVR_ATmega644__
  • __AVR_ATmega645__
  • ... and many others

What we need to design is a symbolic that can be referenced within a sketch compiled for PiDuino that allows the compilation to know that it is being compiled for a PiDuino.

Here are some possibilities for consideration:

  • __PIDUINO__
  • __RASPBERRY_PI__

I would further suggest that we have a second variable that identifies the model of Raspberry Pi. Possibilities for consideration include:

  • __VARIANT_PI_A__
  • __VARIANT_PI_B__
  • __VARIANT_PI_A_PLUS__
  • __VARIANT_PI_B_PLUS__
  • __VARIANT_PI_2_B__
  • __VARIANT_PI_ZERO__

Once we choose and lock down some definitions, we can then approach some of the more popular packages and issue pull requests with the PiDuino definitions added.

nkolban avatar Feb 04 '16 06:02 nkolban