-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
Describe the problem
Compilation of the library for ESP32-based boards (e.g., Arduino Nesso N1, Arduino Nano ESP32) fails:
In file included from c:\Users\foo\Documents\Arduino\libraries\Arduino_BMI270_BMM150\src/Arduino_BMI270_BMM150.h:23,
from C:\Users\foo\AppData\Local\Temp\.arduinoIDE-unsaved20251027-38988-1jcrpj8.x1hi\sketch_nov27a\sketch_nov27a.ino:1:
c:\Users\foo\Documents\Arduino\libraries\Arduino_BMI270_BMM150\src/BoschSensorClass.h: In member function 'int ContinuousMode::available(BoschSensorType_t)':
c:\Users\foo\Documents\Arduino\libraries\Arduino_BMI270_BMM150\src/BoschSensorClass.h:82:21: error: no matching function for call to 'min(uint16_t&, unsigned int)'
82 | _available = min(status, sizeof(fifoData)) / (6 + 6); // 6 bytes per accel sample
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/algorithm:61,
from C:\Users\foo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\cores\esp32/Arduino.h:190,
from C:\Users\foo\AppData\Local\arduino\sketches\7442728C8B4D8B1A0E1FA1810D167768\sketch\sketch_nov27a.ino.cpp:1:
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algo.h:5695:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5695 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algo.h:5695:5: note: template argument deduction/substitution failed:
c:\Users\foo\Documents\Arduino\libraries\Arduino_BMI270_BMM150\src/BoschSensorClass.h:82:21: note: mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'
82 | _available = min(status, sizeof(fifoData)) / (6 + 6); // 6 bytes per accel sample
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algo.h:5685:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5685 | min(initializer_list<_Tp> __l)
| ^~~
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algo.h:5685:5: note: candidate expects 1 argument, 2 provided
In file included from C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/specfun.h:43,
from C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/cmath:3898,
from C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/math.h:36,
from C:\Users\foo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\cores\esp32/esp32-hal.h:30,
from C:\Users\foo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.4\cores\esp32/Arduino.h:44:
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
C:/Users/foo/AppData/Local/Arduino15/packages/esp32/tools/esp-rv32/2507/riscv32-esp-elf/include/c++/14.2.0/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
c:\Users\foo\Documents\Arduino\libraries\Arduino_BMI270_BMM150\src/BoschSensorClass.h:82:21: note: deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'unsigned int')
82 | _available = min(status, sizeof(fifoData)) / (6 + 6); // 6 bytes per accel sample
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~To reproduce
- Create a sketch with following content:
#include <Arduino_BMI270_BMM150.h> void setup() {} void loop() {}
- If it is not already, install the "esp32" or "Arduino ESP32" boards platform.
- Select any board from the "esp32" or "Arduino ESP32" boards platform.
- Compile the sketch.
🐛 The compilation fails.
Arduino_BMI270_BMM150 version
1.2.2
Additional context
The fault does not occur when using Arduino_BMI270_BMM150 version 1.2.1, so this is a regression introduced in 1.2.2.
The regression was clearly indicated by the "Compile Examples" workflow:
Additional reports
Metadata
Metadata
Assignees
Labels
topic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project