Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Nov 1, 2023
1 parent bfa0b85 commit 352f8c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class BrushedMotorHardware : public BrushedMotorHardwareIface {
controller_loop{config.pid_kp, config.pid_ki,
config.pid_kd, 1.F / config.encoder_interrupt_freq,
config.wl_high, config.wl_low},
cancel_request(),
eeprom_config{eeprom_config},
stopwatch_handle{stopwatch_handle} {}
BrushedMotorHardware(const BrushedMotorHardware&) = delete;
Expand Down Expand Up @@ -81,7 +80,7 @@ class BrushedMotorHardware : public BrushedMotorHardwareIface {
auto get_stay_enabled() -> bool final { return stay_enabled; }
// need any std::optional usage?
auto has_cancel_request() -> CancelRequest final {
CancelRequest exchange_request;
CancelRequest exchange_request = {};
return cancel_request.exchange(exchange_request);
}
void request_cancel(can::ids::ErrorSeverity error_severity,
Expand All @@ -92,7 +91,7 @@ class BrushedMotorHardware : public BrushedMotorHardwareIface {
cancel_request.store(update_request);
}
void clear_cancel_request() final {
CancelRequest clear_request;
CancelRequest clear_request = {};
cancel_request.store(clear_request);
}
auto get_usage_eeprom_config() -> const UsageEEpromConfig& final {
Expand All @@ -114,7 +113,7 @@ class BrushedMotorHardware : public BrushedMotorHardwareIface {
int32_t motor_encoder_overflow_count = 0;
ot_utils::pid::PID controller_loop;
std::atomic<ControlDirection> control_dir = ControlDirection::unset;
std::atomic<CancelRequest> cancel_request;
std::atomic<CancelRequest> cancel_request = {};
const UsageEEpromConfig& eeprom_config;
void* stopwatch_handle;
BrushedMotorState motor_state = BrushedMotorState::UNHOMED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class MotorHardware : public StepperMotorHardwareIface {
: pins(config),
tim_handle(timer_handle),
enc_handle(encoder_handle),
eeprom_config(eeprom_config),
cancel_request() {}
eeprom_config(eeprom_config) {}
MotorHardware(const MotorHardware&) = delete;
auto operator=(const MotorHardware&) -> MotorHardware& = delete;
MotorHardware(MotorHardware&&) = delete;
Expand Down Expand Up @@ -60,7 +59,7 @@ class MotorHardware : public StepperMotorHardwareIface {

// need any std::optional usage?
auto has_cancel_request() -> CancelRequest final {
CancelRequest exchange_request;
CancelRequest exchange_request = {};
return cancel_request.exchange(exchange_request);
}
void request_cancel(can::ids::ErrorSeverity error_severity,
Expand All @@ -71,7 +70,7 @@ class MotorHardware : public StepperMotorHardwareIface {
cancel_request.store(update_request);
}
void clear_cancel_request() final {
CancelRequest clear_request;
CancelRequest clear_request = {};
cancel_request.store(clear_request);
}

Expand All @@ -91,7 +90,7 @@ class MotorHardware : public StepperMotorHardwareIface {
void* enc_handle;
const UsageEEpromConfig& eeprom_config;
std::atomic<int32_t> motor_encoder_overflow_count = 0;
std::atomic<CancelRequest> cancel_request;
std::atomic<CancelRequest> cancel_request = {};
static constexpr uint32_t ENCODER_OVERFLOW_PULSES_BIT = 0x1 << 31;
};

Expand Down

0 comments on commit 352f8c8

Please sign in to comment.