boardd: move main() to main.cc for test cases (#23564)
* move main() to main.cc
* move includes back
old-commit-hash: 498d54be9c
commatwo_master
parent
dce057d29f
commit
403e92e9c4
5 changed files with 36 additions and 16 deletions
@ -0,0 +1,6 @@ |
|||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "selfdrive/boardd/panda.h" |
||||||
|
|
||||||
|
bool safety_setter_thread(std::vector<Panda *> pandas); |
||||||
|
void boardd_main_thread(std::vector<std::string> serials); |
@ -0,0 +1,22 @@ |
|||||||
|
#include <cassert> |
||||||
|
|
||||||
|
#include "selfdrive/boardd/boardd.h" |
||||||
|
#include "selfdrive/common/swaglog.h" |
||||||
|
#include "selfdrive/common/util.h" |
||||||
|
#include "selfdrive/hardware/hw.h" |
||||||
|
|
||||||
|
int main(int argc, char *argv[]) { |
||||||
|
LOGW("starting boardd"); |
||||||
|
|
||||||
|
if (!Hardware::PC()) { |
||||||
|
int err; |
||||||
|
err = util::set_realtime_priority(54); |
||||||
|
assert(err == 0); |
||||||
|
err = util::set_core_affinity({Hardware::TICI() ? 4 : 3}); |
||||||
|
assert(err == 0); |
||||||
|
} |
||||||
|
|
||||||
|
std::vector<std::string> serials(argv + 1, argv + argc); |
||||||
|
boardd_main_thread(serials); |
||||||
|
return 0; |
||||||
|
} |
Loading…
Reference in new issue