Little question about cpu type at compile time


#1

Hi David ,

How do you know what string to use to determine the cpu type ?
for example in ulisp 4.5 :
#elif defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_QTPY_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_SEEED_XIAO_RP2040)

How do you know that it has to be ‘ARDUINO_RASPBERRY_PI_PICO’ for example.
I’m asking this for porting it to sparkfun thingplus.
Kind regards,
Ronny


#2

In the Arduino core find the file boards.txt. It’s typically at somewhere like:

/Users/david/Library/Arduino15/packages/rp2040/hardware/rp2040/3.1.0/boards.txt

Open the file and find the section corresponding to the board you’re interested in.

The line .build.board gives the identifier for the board, but you need to prefix ARDUINO_ in front of it.

I can see that the identifier for the Thing Plus RP2040 should be:

ARDUINO_SPARKFUN_THINGPLUS_RP2040

#3

Hi David,
Thanks , found it !
regards,
Ronny