Browse Source

Hal_Chibios: allow for faster INS sample times

we need higher priority on SPI and faster device loops
mission-4.1.18
Andrew Tridgell 7 years ago
parent
commit
b07c599bf2
  1. 4
      libraries/AP_HAL_ChibiOS/Device.cpp
  2. 15
      libraries/AP_HAL_ChibiOS/Scheduler.h

4
libraries/AP_HAL_ChibiOS/Device.cpp

@ -72,8 +72,8 @@ void DeviceBus::bus_thread(void *arg) @@ -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);
}

15
libraries/AP_HAL_ChibiOS/Scheduler.h

@ -25,15 +25,24 @@ @@ -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

Loading…
Cancel
Save