mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
* it's all common * never getting fixed * it's just tici * reorders * qcom2 -> tici * Revert "qcom2 -> tici" This reverts commit f4d849b2952cb0e662975805db6a1d32511ed392. * Reapply "qcom2 -> tici" This reverts commit 58b193cb8de872830f8a7821a339edca14e4a337. * is tici * lil more * Revert "is tici" This reverts commit a169be18d3fdcb3ef8317a63a89d8becadabfad8. * Revert "Reapply "qcom2 -> tici"" This reverts commit 26f9c0e7d068fc8a1a5f07383b3616e619cd4e8c. * qcom2 -> __tici__ * lil more * mv lenv * clean that up * lil more] * fix * lil more
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "system/hardware/base.h"
|
|
#include "common/util.h"
|
|
|
|
#if __TICI__
|
|
#include "system/hardware/tici/hardware.h"
|
|
#define Hardware HardwareTici
|
|
#else
|
|
#include "system/hardware/pc/hardware.h"
|
|
#define Hardware HardwarePC
|
|
#endif
|
|
|
|
namespace Path {
|
|
inline std::string openpilot_prefix() {
|
|
return util::getenv("OPENPILOT_PREFIX", "");
|
|
}
|
|
|
|
inline std::string comma_home() {
|
|
return util::getenv("HOME") + "/.comma" + Path::openpilot_prefix();
|
|
}
|
|
|
|
inline std::string log_root() {
|
|
if (const char *env = getenv("LOG_ROOT")) {
|
|
return env;
|
|
}
|
|
return Hardware::PC() ? Path::comma_home() + "/media/0/realdata" : "/data/media/0/realdata";
|
|
}
|
|
|
|
inline std::string params() {
|
|
return util::getenv("PARAMS_ROOT", Hardware::PC() ? (Path::comma_home() + "/params") : "/data/params");
|
|
}
|
|
|
|
inline std::string rsa_file() {
|
|
return Hardware::PC() ? Path::comma_home() + "/persist/comma/id_rsa" : "/persist/comma/id_rsa";
|
|
}
|
|
|
|
inline std::string swaglog_ipc() {
|
|
return "ipc:///tmp/logmessage" + Path::openpilot_prefix();
|
|
}
|
|
|
|
inline std::string download_cache_root() {
|
|
if (const char *env = getenv("COMMA_CACHE")) {
|
|
return env;
|
|
}
|
|
return "/tmp/comma_download_cache" + Path::openpilot_prefix() + "/";
|
|
}
|
|
|
|
inline std::string shm_path() {
|
|
#ifdef __APPLE__
|
|
return"/tmp";
|
|
#else
|
|
return "/dev/shm";
|
|
#endif
|
|
}
|
|
} // namespace Path
|