Hal_Chibios: allow for faster INS sample times

we need higher priority on SPI and faster device loops
This commit is contained in:
Andrew Tridgell 2018-01-17 19:36:12 +11:00
parent 25f13ed518
commit b07c599bf2
2 changed files with 14 additions and 5 deletions

View File

@ -72,8 +72,8 @@ void DeviceBus::bus_thread(void *arg)
}
// don't delay for less than 400usec, so one thread doesn't
// completely dominate the CPU
if (delay < 400) {
delay = 400;
if (delay < 100) {
delay = 100;
}
hal.scheduler->delay_microseconds(delay);
}

View File

@ -25,15 +25,24 @@
#define APM_MAIN_PRIORITY_BOOST 180 // same as normal for now
#define APM_MAIN_PRIORITY 180
#define APM_TIMER_PRIORITY 178
#define APM_SPI_PRIORITY 179
#define APM_CAN_PRIORITY 177
#define APM_I2C_PRIORITY 176
#define APM_UART_PRIORITY 60
#define APM_STORAGE_PRIORITY 59
#define APM_IO_PRIORITY 58
#define APM_SHELL_PRIORITY 57
#define APM_STARTUP_PRIORITY 10
#ifndef APM_SPI_PRIORITY
#define APM_SPI_PRIORITY 181
#endif
#ifndef APM_CAN_PRIORITY
#define APM_CAN_PRIORITY 177
#endif
#ifndef APM_I2C_PRIORITY
#define APM_I2C_PRIORITY 176
#endif
/* how long to boost priority of the main thread for each main
loop. This needs to be long enough for all interrupt-level drivers
(mostly SPI drivers) to run, and for the main loop of the vehicle