From 17e8a71ff176733562c409e2b42d2c59996646dc Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Fri, 8 Mar 2024 23:30:48 -0600 Subject: [PATCH] can: rename CanRead::start to not hide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from simulator/global.h:25, from ../firmware/pch/pch.h:20, from ../firmware/hw_layer/drivers/can/can_hw.cpp:15: ../firmware/ChibiOS/os/various/cpp_wrappers/ch.hpp:1335:21: error: ‘chibios_rt::ThreadReference chibios_rt::BaseStaticThread::start(tprio_t) [with int N = 1384; tprio_t = unsigned int]’ was hidden [-Werror=overloaded-virtual=] 1335 | ThreadReference start(tprio_t prio) override { | ^~~~~ ../firmware/hw_layer/drivers/can/can_hw.cpp:35:14: note: by ‘void CanRead::start(CANDriver*)’ 35 | void start(CANDriver* device) { | ^~~~~ --- firmware/hw_layer/drivers/can/can_hw.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/firmware/hw_layer/drivers/can/can_hw.cpp b/firmware/hw_layer/drivers/can/can_hw.cpp index 2cd51392c8..4b15337a1a 100644 --- a/firmware/hw_layer/drivers/can/can_hw.cpp +++ b/firmware/hw_layer/drivers/can/can_hw.cpp @@ -32,10 +32,9 @@ class CanRead final : protected ThreadController { { } - void start(CANDriver* device) { - m_device = device; - + void tryStart(CANDriver *device) { if (device) { + m_device = device; ThreadController::start(); } } @@ -192,8 +191,8 @@ void initCan() { } if (engineConfiguration->canReadEnabled) { - canRead1.start(device1); - canRead2.start(device2); + canRead1.tryStart(device1); + canRead2.tryStart(device2); } isCanEnabled = true;