only build sensor features if sensor is available

This commit is contained in:
joeycastillo
2024-10-12 10:55:10 -04:00
parent 378ba85b58
commit 4795818098
15 changed files with 65 additions and 33 deletions

View File

@@ -25,13 +25,11 @@
#include "watch_i2c.h"
#include "i2c.h"
void watch_enable_i2c(void) {
// NOTE: I2C sensors are not supported on Sensor Watch Lite, so there are no SDA/SCL pin definitions.
// This ifdef is here to prevent the build from failing.
#ifdef I2C_SERCOM
void watch_enable_i2c(void) {
HAL_GPIO_SDA_pmuxen(HAL_GPIO_PMUX_SERCOM);
HAL_GPIO_SCL_pmuxen(HAL_GPIO_PMUX_SERCOM);
#endif
i2c_init();
i2c_enable();
}
@@ -92,3 +90,5 @@ uint32_t watch_i2c_read32(int16_t addr, uint8_t reg) {
return data;
}
#endif // I2C_SERCOM