nilay994 / simple-cpp-drone

Making Raspberry Pi send MSP commands to Betaflight
MIT License
2 stars 0 forks source link

[prio] linux thread #18

Open nilay994 opened 3 years ago

nilay994 commented 3 years ago
int policy; 
pthread_getschedparam(natnet_thread_.native_handle(), &policy, &sch);
sch.sched_priority = 20;
if (pthread_setschedparam(natnet_thread_.native_handle(), SCHED_FIFO, &sch)) {
printf("Failed to setschedparam: Natnet thread\n" );
} 

how paparazzi changes the prio of threading when using SPI/I2C/UART. higher priorities are allowed by: In the file sudo nano /etc/security/limits.conf Append:

pi hard rtprio 98 
pi hard priority 98 
pi soft rtprio 98 
pi hard priority 98 
# (priority 99 is for watchdog and other monitoring)