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

@@ -74,7 +74,7 @@ void cb_alarm_fired(void);
void cb_fast_tick(void);
void cb_tick(void);
#ifdef MOTION_BOARD_INSTALLED
#ifdef HAS_ACCELEROMETER
void cb_motion_interrupt_1(void);
#endif
@@ -615,7 +615,7 @@ void app_setup(void) {
watch_register_interrupt_callback(HAL_GPIO_BTN_LIGHT_pin(), cb_light_btn_interrupt, INTERRUPT_TRIGGER_BOTH);
watch_register_interrupt_callback(HAL_GPIO_BTN_ALARM_pin(), cb_alarm_btn_interrupt, INTERRUPT_TRIGGER_BOTH);
#ifdef MOTION_BOARD_INSTALLED
#ifdef HAS_ACCELEROMETER
watch_enable_i2c();
if (lis2dw_begin()) {
lis2dw_set_mode(LIS2DW_MODE_LOW_POWER); // select low power (not high performance)
@@ -917,7 +917,7 @@ void cb_tick(void) {
}
}
#ifdef MOTION_BOARD_INSTALLED
#ifdef HAS_ACCELEROMETER
void cb_motion_interrupt_1(void) {
// TODO: Find out what motion event woke us up.
printf("INT1\n");