mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
pin sensord and lsm interrupt to core 1, for better timing (#25867)
Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com> old-commit-hash: 755f24885aa3e89933cc8ad9784cdaf480156239
This commit is contained in:
committed by
GitHub
parent
219a0f97c7
commit
eaca9b10b7
@@ -174,6 +174,11 @@ int sensor_loop() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// increase interrupt quality by pinning interrupt and process to core 1
|
||||
setpriority(PRIO_PROCESS, 0, -18);
|
||||
util::set_core_affinity({1});
|
||||
std::system("sudo su -c 'echo 1 > /proc/irq/336/smp_affinity_list'");
|
||||
|
||||
PubMaster pm({"sensorEvents"});
|
||||
init_ts = nanos_since_boot();
|
||||
|
||||
@@ -207,7 +212,7 @@ int sensor_loop() {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10) - (end - begin));
|
||||
}
|
||||
|
||||
for (Sensor *sensor : sensors) {
|
||||
for (Sensor *sensor : sensors) {
|
||||
sensor->shutdown();
|
||||
}
|
||||
|
||||
@@ -217,6 +222,5 @@ int sensor_loop() {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
setpriority(PRIO_PROCESS, 0, -18);
|
||||
return sensor_loop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user