microsoft / jacdac-c

Jacdac C Firmware library
https://aka.ms/jacdac
MIT License
13 stars 15 forks source link

Added LPS33HW Pressure Sensor Driver #41

Closed milador closed 2 years ago

milador commented 2 years ago

Added the driver for LPS33HW & LPS35HW Pressure Sensors from STMicroelectronics. The jd_sensor_api is also updated to include pressure and temperature reading APIs for the Pressure Sensors.

milador commented 2 years ago

@mmoskal I made the changes and did the Clang formatting ( had to remove SortIncludes: false as it says undefined key ). I have 4 unused functions which I left for future usage in case someone wants to use the sensor in different configuration. Should I remove them or leave?

Everything else is good.

mmoskal commented 2 years ago

good to leave the functions, as long as they don't give warnings (you can make them non-static, use some magical attribute, or put them in #if 0)

milador commented 2 years ago

@mmoskal I removed static and used __attribute__((unused)). Clang formatting is now not happy with the attribute usage, but the warnings are all gone now.

mmoskal commented 2 years ago

Maybe try attribute before void?

milador commented 2 years ago

@mmoskal Done!

mmoskal commented 2 years ago

Thank you very much!