From cca5ec73bf018372dc7f9f7de8b2e0bf7077660f Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Tue, 16 Jun 2026 14:02:22 +0200 Subject: [PATCH] fix(api): case insensitive issue Having the api/ folder in the include path cause issue between string.h and String.h. See https://github.com/arduino/ArduinoCore-API/issues/37 Signed-off-by: Frederic Pillon --- cmake/set_base_arduino_config.cmake | 2 +- cores/arduino/Arduino.h | 3 +-- cores/arduino/Serial.h | 2 +- cores/arduino/pins_arduino.h | 2 +- cores/arduino/wiring.h | 4 ++-- libraries/SPI/src/SPI.h | 2 +- libraries/Servo/src/Servo.h | 2 +- libraries/SrcWrapper/inc/HardwareTimer.h | 2 +- libraries/Wire/src/Wire.h | 2 +- platform.txt | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cmake/set_base_arduino_config.cmake b/cmake/set_base_arduino_config.cmake index 71a2c9464f..25fe3176d3 100644 --- a/cmake/set_base_arduino_config.cmake +++ b/cmake/set_base_arduino_config.cmake @@ -56,7 +56,7 @@ target_include_directories(base_config INTERFACE "${BUILD_CORE_PATH}" "${BUILD_CORE_PATH}/avr" "${BUILD_CORE_PATH}/stm32" - "${BUILD_CORE_PATH}/api" + "${BUILD_CORE_PATH}/api/deprecated" "${BUILD_LIB_PATH}/SrcWrapper/inc" "${BUILD_LIB_PATH}/SrcWrapper/inc/LL" "${BUILD_LIB_PATH}/USBDevice/inc" diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index 12490e76a1..3118c23ab2 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -33,9 +33,8 @@ #include "SrcWrapper.h" #endif -#include "ArduinoAPI.h" +#include "api/ArduinoAPI.h" #include "wiring.h" -#include "deprecated-avr-comp/avr/dtostrf.h" /* sketch */ diff --git a/cores/arduino/Serial.h b/cores/arduino/Serial.h index 82b2600416..1bb1981f91 100644 --- a/cores/arduino/Serial.h +++ b/cores/arduino/Serial.h @@ -26,7 +26,7 @@ #include -#include "Common.h" +#include "api/Common.h" #include "HardwareSerial.h" #include "Stream.h" #include "uart.h" diff --git a/cores/arduino/pins_arduino.h b/cores/arduino/pins_arduino.h index eb69f98a18..7b109e9ec8 100644 --- a/cores/arduino/pins_arduino.h +++ b/cores/arduino/pins_arduino.h @@ -19,7 +19,7 @@ #define _PINS_ARDUINO_H_ #include #include /* Required for static_assert */ -#include "Common.h" +#include "api/Common.h" #include "variant.h" #include "PinNames.h" diff --git a/cores/arduino/wiring.h b/cores/arduino/wiring.h index e8f76c996c..eafb1e98ec 100644 --- a/cores/arduino/wiring.h +++ b/cores/arduino/wiring.h @@ -26,8 +26,8 @@ #include #include // for struct timeval -#include "Common.h" -#include "deprecated-avr-comp/avr/dtostrf.h" +#include "api/Common.h" +#include "api/deprecated-avr-comp/avr/dtostrf.h" #include "clock.h" #include "dwt.h" #include "interrupt.h" diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index 0fe39ef8e9..b7c6ebe61f 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -13,7 +13,7 @@ #define _SPI_H_INCLUDED #include "Arduino.h" -#include "HardwareSPI.h" +#include "api/HardwareSPI.h" #include extern "C" { #include "utility/spi_com.h" diff --git a/libraries/Servo/src/Servo.h b/libraries/Servo/src/Servo.h index edd0e700d2..cf05e1191d 100644 --- a/libraries/Servo/src/Servo.h +++ b/libraries/Servo/src/Servo.h @@ -48,7 +48,7 @@ #ifndef Servo_h #define Servo_h -#include +#include "api/Common.h" #include /* diff --git a/libraries/SrcWrapper/inc/HardwareTimer.h b/libraries/SrcWrapper/inc/HardwareTimer.h index 669c113f71..a2e0c9aa09 100644 --- a/libraries/SrcWrapper/inc/HardwareTimer.h +++ b/libraries/SrcWrapper/inc/HardwareTimer.h @@ -28,7 +28,7 @@ #define HARDWARETIMER_H_ /* Includes ------------------------------------------------------------------*/ -#include "Common.h" +#include "api/Common.h" #include "timer.h" #include "stm32yyxx_ll_tim.h" diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index 446ee29f1f..e50685437f 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -25,7 +25,7 @@ #include #include "Arduino.h" -#include "HardwareI2C.h" +#include "api/HardwareI2C.h" extern "C" { #include "utility/twi.h" } diff --git a/platform.txt b/platform.txt index 05de08975e..9193fa47ee 100644 --- a/platform.txt +++ b/platform.txt @@ -39,7 +39,7 @@ USBDevice_include_dir={builtin_library_dir}/USBDevice/inc # STM compile variables # ---------------------- -compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{core_stm32_dir}" "-I{api_dir}" "-I{SrcWrapper_include_dir}" "-I{SrcWrapper_include_dir}/LL" "-I{hal_dir}/Inc" "-I{hal_dir}/Src" "-I{build.system.path}/{build.series}" "-I{USBDevice_include_dir}" "-I{usbd_core_dir}/Inc" "-I{usbd_core_dir}/Src" "-I{VirtIO_include_dir}" {build.virtio_extra_include} +compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{core_stm32_dir}" "-I{api_dir}/deprecated" "-I{SrcWrapper_include_dir}" "-I{SrcWrapper_include_dir}/LL" "-I{hal_dir}/Inc" "-I{hal_dir}/Src" "-I{build.system.path}/{build.series}" "-I{USBDevice_include_dir}" "-I{usbd_core_dir}/Inc" "-I{usbd_core_dir}/Src" "-I{VirtIO_include_dir}" {build.virtio_extra_include} compiler.arm.cmsis.c.flags="-I{cmsis_dir}/Core/Include/" "-I{cmsis_dev_dir}/Include/" "-I{cmsis_dev_dir}/Source/Templates/gcc/" "-I{cmsis_dsp}/Include" "-I{cmsis_dsp}/PrivateInclude" compiler.warning_flags=-w