Revert "Add device_type to class Hardware (#20535)"

This reverts commit 9922688f8b.
This commit is contained in:
Willem Melching
2021-03-30 17:36:04 +02:00
parent 9922688f8b
commit 7372b9bba5
4 changed files with 2 additions and 7 deletions
+1 -2
View File
@@ -2,14 +2,13 @@
#include <cstdlib>
#include <fstream>
#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"; };
-2
View File
@@ -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");
-1
View File
@@ -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");
+1 -2
View File
@@ -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;