From 7372b9bba5829f08d201a0226a7a86fd2d554e04 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 30 Mar 2021 17:36:04 +0200 Subject: [PATCH] Revert "Add device_type to class Hardware (#20535)" This reverts commit 9922688f8b43425b16b9be6e445dfa87348055e4. --- selfdrive/hardware/base.h | 3 +-- selfdrive/hardware/eon/hardware.h | 2 -- selfdrive/hardware/tici/hardware.h | 1 - selfdrive/ui/qt/home.cc | 3 +-- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/selfdrive/hardware/base.h b/selfdrive/hardware/base.h index c6397c3414..c82610d93a 100644 --- a/selfdrive/hardware/base.h +++ b/selfdrive/hardware/base.h @@ -2,14 +2,13 @@ #include #include -#include "cereal/gen/cpp/log.capnp.h" + // no-op base hw class class HardwareNone { public: static constexpr float MAX_VOLUME = 0; static constexpr float MIN_VOLUME = 0; - static const cereal::InitData::DeviceType device_type = cereal::InitData::DeviceType::PC; static std::string get_os_version() { return "openpilot for PC"; }; diff --git a/selfdrive/hardware/eon/hardware.h b/selfdrive/hardware/eon/hardware.h index bdb0271653..bcf99a6284 100644 --- a/selfdrive/hardware/eon/hardware.h +++ b/selfdrive/hardware/eon/hardware.h @@ -14,8 +14,6 @@ class HardwareEon : public HardwareNone { public: static constexpr float MAX_VOLUME = 1.0; static constexpr float MIN_VOLUME = 0.5; - static constexpr float MIN_VOLUME = 0.5; - static const cereal::InitData::DeviceType device_type = cereal::InitData::DeviceType::EON; static std::string get_os_version() { return "NEOS " + util::read_file("/VERSION"); diff --git a/selfdrive/hardware/tici/hardware.h b/selfdrive/hardware/tici/hardware.h index 782de192e4..705f8b81e2 100644 --- a/selfdrive/hardware/tici/hardware.h +++ b/selfdrive/hardware/tici/hardware.h @@ -11,7 +11,6 @@ class HardwareTici : public HardwareNone { public: static constexpr float MAX_VOLUME = 0.5; static constexpr float MIN_VOLUME = 0.4; - static const cereal::InitData::DeviceType device_type = cereal::InitData::DeviceType::TICI; static std::string get_os_version() { return "AGNOS " + util::read_file("/VERSION"); diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index e609227290..f36acb1676 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -199,8 +199,7 @@ static void handle_display_state(UIState* s, bool user_input) { constexpr float accel_samples = 5*UI_FREQ; static float accel_prev = 0., gyro_prev = 0.; - bool should_wake = s->scene.started || s->scene.ignition || - user_input || Hardware::device_type == cereal::InitData::DeviceType::PC; + bool should_wake = s->scene.started || s->scene.ignition || user_input; if (!should_wake) { // tap detection while display is off bool accel_trigger = abs(s->scene.accel_sensor - accel_prev) > 0.2;