mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
AP_HAL_Linux: added scheduler hooks for raspilot
This commit is contained in:
parent
25cddbcbaa
commit
30a2fe0857
@ -8,6 +8,7 @@
|
||||
#include "UARTDriver.h"
|
||||
#include "Util.h"
|
||||
#include "SPIUARTDriver.h"
|
||||
#include "RPIOUARTDriver.h"
|
||||
#include <sys/time.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
@ -269,6 +270,15 @@ void LinuxScheduler::_run_timers(bool called_from_timer_thread)
|
||||
_timer_proc[i]();
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT
|
||||
//SPI UART use SPI
|
||||
if (!((LinuxRPIOUARTDriver *)hal.uartC)->isExternal() )
|
||||
{
|
||||
((LinuxRPIOUARTDriver *)hal.uartC)->_timer_tick();
|
||||
}
|
||||
#endif
|
||||
|
||||
_timer_semaphore.give();
|
||||
|
||||
// and the failsafe, if one is setup
|
||||
@ -349,7 +359,15 @@ void *LinuxScheduler::_uart_thread(void* arg)
|
||||
// process any pending serial bytes
|
||||
((LinuxUARTDriver *)hal.uartA)->_timer_tick();
|
||||
((LinuxUARTDriver *)hal.uartB)->_timer_tick();
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_RASPILOT
|
||||
//SPI UART not use SPI
|
||||
if ( ((LinuxRPIOUARTDriver *)hal.uartC)->isExternal() )
|
||||
{
|
||||
((LinuxRPIOUARTDriver *)hal.uartC)->_timer_tick();
|
||||
}
|
||||
#else
|
||||
((LinuxUARTDriver *)hal.uartC)->_timer_tick();
|
||||
#endif
|
||||
((LinuxUARTDriver *)hal.uartE)->_timer_tick();
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user