diff --git a/firmware/controllers/buttonshift.cpp b/firmware/controllers/buttonshift.cpp index f44684dc0c..e74c1a5bae 100644 --- a/firmware/controllers/buttonshift.cpp +++ b/firmware/controllers/buttonshift.cpp @@ -14,8 +14,8 @@ ButtonShiftController buttonShiftController; void ButtonShiftController::init (DECLARE_ENGINE_PARAMETER_SIGNATURE) { // 500 millisecond is maybe a little long? - debounceUp.init(500, &CONFIG(tcuUpshiftButtonPin), &CONFIG(tcuUpshiftButtonPinMode)); - debounceDown.init(500, &CONFIG(tcuDownshiftButtonPin), &CONFIG(tcuDownshiftButtonPinMode)); + debounceUp.init(500, CONFIG(tcuUpshiftButtonPin), CONFIG(tcuUpshiftButtonPinMode)); + debounceDown.init(500, CONFIG(tcuDownshiftButtonPin), CONFIG(tcuDownshiftButtonPinMode)); } void ButtonShiftController::update() { diff --git a/firmware/controllers/sensors/allsensors.cpp b/firmware/controllers/sensors/allsensors.cpp index d350574d11..829be2d818 100644 --- a/firmware/controllers/sensors/allsensors.cpp +++ b/firmware/controllers/sensors/allsensors.cpp @@ -16,7 +16,7 @@ ButtonDebounce acDebounce; void initSensors(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { initMapDecoder(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX); - acDebounce.init(15, &CONFIG(acSwitch), &CONFIG(acSwitchMode)); + acDebounce.init(15, CONFIG(acSwitch), CONFIG(acSwitchMode)); } bool getAcToggle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { diff --git a/firmware/controllers/start_stop.cpp b/firmware/controllers/start_stop.cpp index bda1f21a1a..95cef2307b 100644 --- a/firmware/controllers/start_stop.cpp +++ b/firmware/controllers/start_stop.cpp @@ -7,5 +7,5 @@ ButtonDebounce startStopButtonDebounce; void initStartStopButton(DECLARE_ENGINE_PARAMETER_SIGNATURE) { /* startCrankingDuration is efitimesec_t, so we need to multiply it by 1000 to get milliseconds*/ - startStopButtonDebounce.init((CONFIG(startCrankingDuration)*1000), &CONFIG(startStopButtonPin), &CONFIG(startStopButtonMode)); + startStopButtonDebounce.init((CONFIG(startCrankingDuration)*1000), CONFIG(startStopButtonPin), CONFIG(startStopButtonMode)); } diff --git a/firmware/hw_layer/debounce.cpp b/firmware/hw_layer/debounce.cpp index faed5cab94..def299bb65 100644 --- a/firmware/hw_layer/debounce.cpp +++ b/firmware/hw_layer/debounce.cpp @@ -15,7 +15,7 @@ ButtonDebounce* ButtonDebounce::s_firstDebounce = nullptr; /** We need to have a separate init function because we do not have the pin or mode in the context in which the class is originally created */ -void ButtonDebounce::init (efitimems_t threshold, brain_pin_e *pin, pin_input_mode_e *mode) { +void ButtonDebounce::init (efitimems_t threshold, brain_pin_e &pin, pin_input_mode_e &mode) { // we need to keep track of whether we have already been initialized due to the way unit tests run. if (!initialized) { // Link us to the list that is used to track ButtonDebounce instances, so that when the configuration changes, @@ -25,8 +25,8 @@ void ButtonDebounce::init (efitimems_t threshold, brain_pin_e *pin, pin_input_mo } m_threshold = MS2NT(threshold); timeLast = 0; - m_pin = pin; - m_mode = mode; + m_pin = &pin; + m_mode = &mode; startConfiguration(); initialized = true; } diff --git a/firmware/hw_layer/debounce.h b/firmware/hw_layer/debounce.h index dc6adaed31..b766014016 100644 --- a/firmware/hw_layer/debounce.h +++ b/firmware/hw_layer/debounce.h @@ -15,7 +15,7 @@ class ButtonDebounce { public: - void init(efitimems_t threshold, brain_pin_e *pin, pin_input_mode_e *mode); + void init(efitimems_t threshold, brain_pin_e &pin, pin_input_mode_e &mode); void stopConfiguration(); void startConfiguration(); bool readPinEvent();