Preprocessor defines for STAMP-C
-
Hello,
When I write my code (in Arduino IDE) I like to be able to differentiate between microcontroller targets.
To check for a Arduino Pro Micro, I use:
if defined(ARDUINO_AVR_MICRO)
e.g.For an Adafruit Trinket M0:
if defined(ARDUINO_TRINKET_M0)
can be used.I tried to determine what I could use for M5STACK STAMP-C.
But I have been unable to find out what I could use.
Normally, when I toggle verbose compiler output, I can find a symbol.
But for a stamp-c compile, I just get:/home/bram/.arduino15/packages/m5stack/tools/riscv32-esp-elf-gcc/gcc8_4_0-esp-2021r2/bin/riscv32-esp-elf-g++ -DHAVE_CONFIG_H "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE "-DIDF_VER=\"v4.4-beta1-189-ga79dc75f0a\"" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/config -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/newlib/platform_include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/freertos/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/freertos/port/riscv/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/freertos/include/esp_additions -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hw_support/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hw_support/include/soc -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hw_support/include/soc/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/private_include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/heap/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/log/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/lwip/include/apps -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/lwip/include/apps/sntp -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/lwip/lwip/src/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/lwip/port/esp32/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/lwip/port/esp32/include/arch -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/soc/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/soc/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/soc/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/hal/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/hal/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/hal/platform_port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_rom/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_rom/include/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_rom/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_common/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_system/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_system/port/soc -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_system/port/include/riscv -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_system/port/public_compat -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/riscv/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/driver/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/driver/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_pm/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_ringbuf/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/efuse/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/efuse/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/vfs/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_wifi/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_event/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_netif/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_eth/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/tcpip_adapter/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_phy/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_phy/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_ipc/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/app_trace/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_timer/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/mbedtls/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/mbedtls/mbedtls/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/mbedtls/esp_crt_bundle/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/app_update/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/spi_flash/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bootloader_support/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/nvs_flash/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/pthread/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_gdbstub/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_gdbstub/riscv -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_gdbstub/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/espcoredump/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/espcoredump/include/port/riscv -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/wpa_supplicant/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/wpa_supplicant/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/wpa_supplicant/esp_supplicant/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/ieee802154/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/console -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/asio/asio/asio/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/asio/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/common/osi/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/include/esp32c3/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/common/api/include/api -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/common/btc/profile/esp/blufi/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/common/btc/profile/esp/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/bt/host/bluedroid/api/include/api -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/cbor/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/unity/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/unity/unity/src -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/cmock/CMock/src -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/coap/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/coap/libcoap/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/nghttp/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/nghttp/nghttp2/lib/includes -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-tls -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-tls/esp-tls-crypto -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_adc_cal/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_hid/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/tcp_transport/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_http_client/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_http_server/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_https_ota/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_https_server/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_lcd/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_lcd/interface -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/protobuf-c/protobuf-c -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/protocomm/include/common -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/protocomm/include/security -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/protocomm/include/transports -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/mdns/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_local_ctrl/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/sdmmc/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_serial_slave_link/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_websocket_client/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/expat/expat/expat/lib -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/expat/port/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/wear_levelling/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/fatfs/diskio -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/fatfs/vfs -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/fatfs/src -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/freemodbus/common/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/idf_test/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/idf_test/include/esp32c3 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/jsmn/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/json/cJSON -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/libsodium/libsodium/src/libsodium/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/libsodium/port_include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/mqtt/esp-mqtt/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/openssl/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/spiffs/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/wifi_provisioning/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_littlefs/src -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp_littlefs/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/tool -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/typedef -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/image -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/math -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/nn -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/layer -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/detect -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/esp-face/include/model_zoo -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/tools/sdk/esp32c3/include/fb_gfx/include -march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fno-exceptions -fno-rtti -c -w -x c++ -E -CC -DF_CPU=160000000L -DARDUINO=10820 -DARDUINO_STAMP_C3 -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"STAMP_C3\"" "-DARDUINO_VARIANT=\"m5stack_stamp_c3\"" -DARDUINO_PARTITION_default -DESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_HW_CDC_ON_BOOT=0 @/home/bram/Arduino/builds/build_opt.h -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/cores/esp32 -I/home/bram/.arduino15/packages/m5stack/hardware/esp32/2.0.2/variants/m5stack_stamp_c3 /home/bram/Arduino/builds/sketch/stamptest.ino.cpp -o /dev/null
I cannot use ESP_PLATFORM, as that is too generic.
Also, esp_config.h does not contain board identifiers.
Anyone here knows what should be used for conditional compiles on STAMP-C?
Thanks!
-
@bram the stamp Pico uses the esp32 Pico D3 the Stamp C uses the ESP32 C3 which is a RiscV processor
-
@ajb2k3 said in Preprocessor defines for STAMP-C:
@bram the stamp Pico uses the esp32 Pico D3 the Stamp C uses the ESP32 C3 which is a RiscV processor
Yes, I know that.
It works fine. But I want a preprocessor define to conditionally compile code.
-
I have been using ARDUINO_ESP32C3_DEV to differentiate between Espressif dev board and StampC3, in combination with ESP_PLATFORM.