Files
StarPilot/selfdrive/hardware/base.h
T
Dean Lee e0282ced49 Replace ifdefs with hardware abstraction layer (#20801)
* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error
old-commit-hash: 757d2923d2bfcda620b252e21a348ac3f87f3a63
2021-05-06 11:41:46 +02:00

34 lines
754 B
C++

#pragma once
#include <cstdlib>
#include <fstream>
// no-op base hw class
class HardwareNone {
public:
enum Type {
typePC,
typeEON,
typeTICI
};
static constexpr float MAX_VOLUME = 0;
static constexpr float MIN_VOLUME = 0;
static std::string get_os_version() { return "openpilot for PC"; }
static void reboot() {}
static void poweroff() {}
static void set_brightness(int percent) {}
static void set_display_power(bool on) {}
static bool get_ssh_enabled() { return false; }
static void set_ssh_enabled(bool enabled) {}
static Type type() { return typePC; }
static bool PC() { return type() == typePC; }
static bool EON() { return type() == typeEON; }
static bool TICI() { return type() == typeTICI; }
};