Skip to content

Commit a867a4a

Browse files
Use const reference to reduce copy
Signed-off-by: Taylor Lineman <git@actuallytaylor.com>
1 parent 2ef63f7 commit a867a4a

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ include(CMakeDependentOption)
3636
include(${EVT_CORE_DIR}/cmake/evt-core_compiler.cmake)
3737
include(${EVT_CORE_DIR}/cmake/evt-core_install.cmake)
3838

39-
4039
set(CMAKE_C_FLAGS_RELEASE "-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wall -fdata-sections -ffunction-sections -MMD -MP -MF -ggdb -std=gnu99 -fno-rtti -Wvla -Os -s")
4140
set(CMAKE_CXX_FLAGS_RELEASE "-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -Wall -fdata-sections -ffunction-sections -MMD -MP -MF -ggdb -std=gnu99 -fno-rtti -Wvla -Os -s")
4241

include/BMS.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ class BMS : public CANDevice {
8383
* @param[in] resetHandler Handler for reset messages
8484
* @param[in] iwdg Internal watchdog to ensure the BMS code is running without getting stuck
8585
*/
86-
BMS(BQSettingsStorage& bqSettingsStorage, dev::BQ76952 bq, dev::Interlock& interlock,
86+
BMS(BQSettingsStorage& bqSettingsStorage, const dev::BQ76952 &bq, dev::Interlock& interlock,
8787
IO::GPIO& alarm, SystemDetect& systemDetect, IO::GPIO& bmsOK, IO::GPIO& errorLed,
88-
dev::ThermistorMux& thermMux, ResetHandler& resetHandler, core::dev::IWDG& iwdg);
88+
const dev::ThermistorMux& thermMux, ResetHandler& resetHandler, core::dev::IWDG& iwdg);
8989

9090
/**
9191
* The node ID used to identify the device on the CAN network.

src/BMS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace log = core::log;
1111

1212
namespace BMS {
1313

14-
BMS::BMS(BQSettingsStorage& bqSettingsStorage, dev::BQ76952 bq,
14+
BMS::BMS(BQSettingsStorage& bqSettingsStorage, const dev::BQ76952 &bq,
1515
dev::Interlock& interlock, IO::GPIO& alarm, SystemDetect& systemDetect,
16-
IO::GPIO& bmsOK, IO::GPIO& errorLed, dev::ThermistorMux& thermMux,
16+
IO::GPIO& bmsOK, IO::GPIO& errorLed, const dev::ThermistorMux& thermMux,
1717
ResetHandler& resetHandler, core::dev::IWDG& iwdg) : bqSettingsStorage(bqSettingsStorage),
1818
bq(bq), state(State::START), interlock(interlock),
1919
alarm(alarm), systemDetect(systemDetect), resetHandler(resetHandler),

0 commit comments

Comments
 (0)