Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sensors): rename shared-sensor to using-both-sensors #787

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/sensors/core/tasks/capacitive_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ class FDC1004 {
public:
FDC1004(I2CQueueWriter &writer, I2CQueuePoller &poller,
CanClient &can_client, OwnQueue &own_queue,
sensors::hardware::SensorHardwareBase &hardware, bool shared_sensor,
sensors::hardware::SensorHardwareBase &hardware,
bool using_both_sensors,
std::array<float, SENSOR_BUFFER_SIZE> *sensor_buffer)
: writer(writer),
poller(poller),
can_client(can_client),
own_queue(own_queue),
hardware(hardware),
shared_sensor(shared_sensor),
using_both_sensors(using_both_sensors),
sensor_buffer(sensor_buffer) {}

[[nodiscard]] auto initialized() const -> bool { return _initialized; }
Expand Down Expand Up @@ -82,7 +83,7 @@ class FDC1004 {
auto get_sensor_id() -> can::ids::SensorId { return sensor_id; }

auto set_sensor_id(can::ids::SensorId _id) -> void {
if (shared_sensor && sensor_id != _id) {
if (using_both_sensors && sensor_id != _id) {
if (_id == can::ids::SensorId::S1) {
measure_mode = fdc1004::MeasureConfigMode::TWO;
} else {
Expand Down Expand Up @@ -398,7 +399,7 @@ class FDC1004 {
fdc1004::MeasureConfigMode measure_mode = fdc1004::MeasureConfigMode::ONE;
fdc1004::MeasurementRate measurement_rate =
fdc1004::MeasurementRate::ONE_HUNDRED_SAMPLES_PER_SECOND;
bool shared_sensor = false;
bool using_both_sensors = false;

float current_offset_pf = 0;
float zero_threshold_pf = 30;
Expand Down
Loading