sparkfun / SparkFun_Bio_Sensor_Hub_Library

26 stars 33 forks source link

Uable to use with STM32 #25

Closed VASAPOL closed 1 year ago

VASAPOL commented 1 year ago

Unable to compile with STM32L432KC ERROR:

In file included from src/main.cpp:2: .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:73:30: error: 'SUCCESS' conflicts with a previous declaration 73 | SUCCESS = 0x00, | ^~~~ In file included from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/stm32_def.h:48, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/clock.h:19, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:23, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/libraries/Wire/src/Wire.h:26, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:4, from src/main.cpp:2: /Users/vasapol/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:200:3: note: previous declaration 'ErrorStatus SUCCESS' 200 | SUCCESS = 0, | ^~~ In file included from src/main.cpp:2: .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:124:30: error: 'RESET' conflicts with a previous declaration 124 | RESET = 0x02, | ^~~~ In file included from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/stm32_def.h:48, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/clock.h:19, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:23, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/libraries/Wire/src/Wire.h:26, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:4, from src/main.cpp:2: /Users/vasapol/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:187:3: note: previous declaration 'FlagStatus RESET' 187 | RESET = 0, | ^~~~~ Compiling .pio/build/nucleo_l432kc/FrameworkArduino/RingBuffer.cpp.o [.pio/build/nucleo_l432kc/src/main.cpp.o] Error 1 In file included from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.cpp:21: .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:73:30: error: 'SUCCESS' conflicts with a previous declaration 73 | SUCCESS = 0x00, | ^~~~ In file included from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/stm32_def.h:48, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/clock.h:19, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:23, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/libraries/Wire/src/Wire.h:26, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:4, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.cpp:21: /Users/vasapol/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:200:3: note: previous declaration 'ErrorStatus SUCCESS' 200 | SUCCESS = 0, | ^~~ In file included from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.cpp:21: .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:124:30: error: 'RESET' conflicts with a previous declaration 124 | RESET = 0x02, | ^~~~ In file included from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/stm32_def.h:48, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/stm32/clock.h:19, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring_time.h:23, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/wiring.h:38, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/cores/arduino/Arduino.h:36, from /Users/vasapol/.platformio/packages/framework-arduinoststm32/libraries/Wire/src/Wire.h:26, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.h:4, from .pio/libdeps/nucleo_l432kc/SparkFun Bio Sensor Hub Library/src/SparkFun_Bio_Sensor_Hub_Library.cpp:21: /Users/vasapol/.platformio/packages/framework-arduinoststm32/system/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h:187:3: note: previous declaration 'FlagStatus RESET' 187 | RESET = 0, | ^~~~~ [.pio/build/nucleo_l432kc/lib68c/SparkFun Bio Sensor Hub Library/SparkFun_Bio_Sensor_Hub_Library.cpp.o] Error 1

edspark commented 1 year ago

This is a silly mistake, but some of the variables in this library were named so generically that they conflicted with the variables within the STM32 core libraries: SUCCESS and RESET. This will be fixed in the latest release.