Is there a macro to recognize the board type or the pico chip?
There is a board identification macro that the Arduino build system defines only when compiling for the Nano RP2040 Connect:
As for identifying the RP2040 in general, I don't know what is available. There is a convention for Arduino boards platforms to define an architecture identification macro, but the Arduino Nano RP2040 Connect 's "Arduino Mbed OS Nano Boards" platform actually use a different architecture (
ARDUINO_ARCH_MBED_NANO) from the one used by the "Arduino Mbed OS RP2040 Boards" platform (
ARDUINO_ARCH_MBED_RP2040) , and the 3rd party earlephilhower/arduino-pico platform yet another (
Of course, you can just check if any of those macros are defined.
Ok, this helps.