diff --git a/include/can/core/ids.hpp b/include/can/core/ids.hpp index e32dd038e..66a1ac2e3 100644 --- a/include/can/core/ids.hpp +++ b/include/can/core/ids.hpp @@ -216,6 +216,7 @@ enum class SensorOutputBinding { report = 0x2, max_threshold_sync = 0x4, auto_baseline_report = 0x8, + multi_sensor_sync = 0x10, }; /** How a sensor's threshold should be interpreted. */ diff --git a/include/sensors/core/tasks/capacitive_driver.hpp b/include/sensors/core/tasks/capacitive_driver.hpp index 3339a825b..4fd5ed3ef 100644 --- a/include/sensors/core/tasks/capacitive_driver.hpp +++ b/include/sensors/core/tasks/capacitive_driver.hpp @@ -91,8 +91,10 @@ class FDC1004 { void set_bind_sync(bool should_bind) { bind_sync = should_bind; - hardware.set_sync_required(sensor_id); - hardware.reset_sync(sensor_id); + hardware.set_sync_enabled(sensor_id, should_bind); + } + void set_multi_sensor_sync(bool should_bind) { + hardware.set_sync_required(sensor_id, should_bind); } void set_max_bind_sync(bool should_bind) { @@ -279,6 +281,7 @@ class FDC1004 { if (max_capacitance_sync) { if (capacitance > fdc1004::MAX_CAPACITANCE_READING) { + // Use the set_sync that always sets the sync line here hardware.set_sync(); } else { hardware.reset_sync(sensor_id); diff --git a/include/sensors/core/tasks/pressure_driver.hpp b/include/sensors/core/tasks/pressure_driver.hpp index 04f3bd359..4bdb7f579 100644 --- a/include/sensors/core/tasks/pressure_driver.hpp +++ b/include/sensors/core/tasks/pressure_driver.hpp @@ -88,8 +88,11 @@ class MMR920 { void set_bind_sync(bool should_bind) { bind_sync = should_bind; + hardware.set_sync_enabled(sensor_id, should_bind); + } + + void set_multi_sensor_sync(bool should_bind) { hardware.set_sync_required(sensor_id, should_bind); - hardware.reset_sync(sensor_id); } void set_max_bind_sync(bool should_bind) { diff --git a/include/sensors/core/tasks/pressure_sensor_task.hpp b/include/sensors/core/tasks/pressure_sensor_task.hpp index 83f4294a8..af9bf9f05 100644 --- a/include/sensors/core/tasks/pressure_sensor_task.hpp +++ b/include/sensors/core/tasks/pressure_sensor_task.hpp @@ -130,6 +130,9 @@ class PressureMessageHandler { driver.set_echoing( m.binding & static_cast(can::ids::SensorOutputBinding::report)); + driver.set_multi_sensor_sync( + m.binding & + static_cast(can::ids::SensorOutputBinding::multi_sensor_sync)); driver.set_bind_sync( m.binding & static_cast(can::ids::SensorOutputBinding::sync));