Merge common/ and selfdrive/common (#24556)
* Merge common/ and selfdrive/common * fix that * fix version * fix unit testspull/24554/head
parent
e4b7791044
commit
cb8885cffb
140 changed files with 290 additions and 289 deletions
@ -1,4 +1,39 @@ |
||||
Import('envCython', 'common') |
||||
Import('env', 'envCython', 'arch', 'SHARED') |
||||
|
||||
if SHARED: |
||||
fxn = env.SharedLibrary |
||||
else: |
||||
fxn = env.Library |
||||
|
||||
common_libs = [ |
||||
'params.cc', |
||||
'statlog.cc', |
||||
'swaglog.cc', |
||||
'util.cc', |
||||
'gpio.cc', |
||||
'i2c.cc', |
||||
'watchdog.cc', |
||||
] |
||||
|
||||
_common = fxn('common', common_libs, LIBS="json11") |
||||
|
||||
files = [ |
||||
'clutil.cc', |
||||
'visionimg.cc', |
||||
] |
||||
|
||||
if arch == "larch64": |
||||
_gpu_libs = ["GLESv2"] |
||||
else: |
||||
_gpu_libs = ["GL"] |
||||
|
||||
_gpucommon = fxn('gpucommon', files, LIBS=_gpu_libs) |
||||
Export('_common', '_gpucommon', '_gpu_libs') |
||||
|
||||
if GetOption('test'): |
||||
env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common]) |
||||
env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread']) |
||||
|
||||
# Cython |
||||
envCython.Program('clock.so', 'clock.pyx') |
||||
envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [common, 'zmq']) |
||||
envCython.Program('params_pyx.so', 'params_pyx.pyx', LIBS=envCython['LIBS'] + [_common, 'zmq', 'json11']) |
||||
|
@ -1,10 +1,10 @@ |
||||
#include "selfdrive/common/clutil.h" |
||||
#include "common/clutil.h" |
||||
|
||||
#include <cassert> |
||||
#include <iostream> |
||||
#include <memory> |
||||
|
||||
#include "selfdrive/common/util.h" |
||||
#include "common/util.h" |
||||
|
||||
namespace { // helper functions
|
||||
|
@ -1,11 +1,11 @@ |
||||
#include "selfdrive/common/gpio.h" |
||||
#include "common/gpio.h" |
||||
|
||||
#include <fcntl.h> |
||||
#include <unistd.h> |
||||
|
||||
#include <cstring> |
||||
|
||||
#include "selfdrive/common/util.h" |
||||
#include "common/util.h" |
||||
|
||||
// We assume that all pins have already been exported on boot,
|
||||
// and that we have permission to write to them.
|
@ -1,7 +1,7 @@ |
||||
#pragma once |
||||
|
||||
#include <array> |
||||
#include "selfdrive/common/mat.h" |
||||
#include "common/mat.h" |
||||
#include "selfdrive/hardware/hw.h" |
||||
|
||||
const int TRAJECTORY_SIZE = 33; |
@ -1,6 +1,6 @@ |
||||
#pragma once |
||||
|
||||
#include "selfdrive/common/timing.h" |
||||
#include "common/timing.h" |
||||
|
||||
#define CLOUDLOG_DEBUG 10 |
||||
#define CLOUDLOG_INFO 20 |
@ -0,0 +1,2 @@ |
||||
test_util |
||||
test_swaglog |
@ -1,4 +1,4 @@ |
||||
#include "selfdrive/common/util.h" |
||||
#include "common/util.h" |
||||
|
||||
#include <sys/stat.h> |
||||
#include <dirent.h> |
@ -1,4 +1,4 @@ |
||||
#include "selfdrive/common/visionimg.h" |
||||
#include "common/visionimg.h" |
||||
|
||||
#include <cassert> |
||||
|
@ -1,6 +1,6 @@ |
||||
#include "selfdrive/common/watchdog.h" |
||||
#include "selfdrive/common/timing.h" |
||||
#include "selfdrive/common/util.h" |
||||
#include "common/watchdog.h" |
||||
#include "common/timing.h" |
||||
#include "common/util.h" |
||||
|
||||
const std::string watchdog_fn_prefix = "/dev/shm/wd_"; // + <pid>
|
||||
|
Binary file not shown.
@ -1,35 +0,0 @@ |
||||
Import('env', 'arch', 'SHARED') |
||||
|
||||
if SHARED: |
||||
fxn = env.SharedLibrary |
||||
else: |
||||
fxn = env.Library |
||||
|
||||
common_libs = [ |
||||
'params.cc', |
||||
'statlog.cc', |
||||
'swaglog.cc', |
||||
'util.cc', |
||||
'gpio.cc', |
||||
'i2c.cc', |
||||
'watchdog.cc', |
||||
] |
||||
|
||||
_common = fxn('common', common_libs, LIBS="json11") |
||||
|
||||
files = [ |
||||
'clutil.cc', |
||||
'visionimg.cc', |
||||
] |
||||
|
||||
if arch == "larch64": |
||||
_gpu_libs = ["GLESv2"] |
||||
else: |
||||
_gpu_libs = ["GL"] |
||||
|
||||
_gpucommon = fxn('gpucommon', files, LIBS=_gpu_libs) |
||||
Export('_common', '_gpucommon', '_gpu_libs') |
||||
|
||||
if GetOption('test'): |
||||
env.Program('tests/test_util', ['tests/test_util.cc'], LIBS=[_common]) |
||||
env.Program('tests/test_swaglog', ['tests/test_swaglog.cc'], LIBS=[_common, 'json11', 'zmq', 'pthread']) |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue