APM:Libraries
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
VRBRAIN::VRBRAINScheduler Class Reference

#include <Scheduler.h>

Inheritance diagram for VRBRAIN::VRBRAINScheduler:
[legend]
Collaboration diagram for VRBRAIN::VRBRAINScheduler:
[legend]

Classes

struct  _uavcan_thread_arg
 

Public Member Functions

 VRBRAINScheduler ()
 
void init ()
 
void delay (uint16_t ms)
 
void delay_microseconds (uint16_t us)
 
void delay_microseconds_boost (uint16_t us)
 
void register_timer_process (AP_HAL::MemberProc)
 
void register_io_process (AP_HAL::MemberProc)
 
void register_timer_failsafe (AP_HAL::Proc, uint32_t period_us)
 
void suspend_timer_procs ()
 
void resume_timer_procs ()
 
void reboot (bool hold_in_bootloader)
 
bool in_main_thread () const override
 
void system_initialized ()
 
void hal_initialized ()
 
void create_uavcan_thread () override
 
- Public Member Functions inherited from AP_HAL::Scheduler
 Scheduler ()
 
virtual void boost_end (void)
 
virtual void register_delay_callback (AP_HAL::Proc, uint16_t min_time_ms)
 
virtual bool in_delay_callback () const
 
virtual void stop_clock (uint64_t time_usec)
 
virtual void * disable_interrupts_save (void)
 
virtual void restore_interrupts (void *)
 
virtual void call_delay_cb ()
 

Private Member Functions

void _run_timers (bool called_from_timer_thread)
 
void _run_io (void)
 
void delay_microseconds_semaphore (uint16_t us)
 

Static Private Member Functions

static void * _timer_thread (void *arg)
 
static void * _io_thread (void *arg)
 
static void * _storage_thread (void *arg)
 
static void * _uart_thread (void *arg)
 
static void * _uavcan_thread (void *arg)
 

Private Attributes

bool _initialized
 
volatile bool _hal_initialized
 
AP_HAL::Proc _failsafe
 
volatile bool _timer_suspended
 
AP_HAL::MemberProc _timer_proc [VRBRAIN_SCHEDULER_MAX_TIMER_PROCS]
 
uint8_t _num_timer_procs
 
volatile bool _in_timer_proc
 
AP_HAL::MemberProc _io_proc [VRBRAIN_SCHEDULER_MAX_TIMER_PROCS]
 
uint8_t _num_io_procs
 
volatile bool _in_io_proc
 
volatile bool _timer_event_missed
 
pid_t _main_task_pid
 
pthread_t _timer_thread_ctx
 
pthread_t _io_thread_ctx
 
pthread_t _storage_thread_ctx
 
pthread_t _uart_thread_ctx
 
pthread_t _uavcan_thread_ctx
 
perf_counter_t _perf_timers
 
perf_counter_t _perf_io_timers
 
perf_counter_t _perf_storage_timer
 
perf_counter_t _perf_delay
 

Additional Inherited Members

- Public Attributes inherited from AP_HAL::Scheduler
uint16_t _min_delay_cb_ms
 

Detailed Description

Definition at line 44 of file Scheduler.h.

Constructor & Destructor Documentation

◆ VRBRAINScheduler()

VRBRAINScheduler::VRBRAINScheduler ( )

Definition at line 38 of file Scheduler.cpp.

Member Function Documentation

◆ _io_thread()

void * VRBRAINScheduler::_io_thread ( void *  arg)
staticprivate

Definition at line 367 of file Scheduler.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _run_io()

void VRBRAINScheduler::_run_io ( void  )
private

Definition at line 325 of file Scheduler.cpp.

Referenced by _io_thread().

Here is the caller graph for this function:

◆ _run_timers()

void VRBRAINScheduler::_run_timers ( bool  called_from_timer_thread)
private

Definition at line 259 of file Scheduler.cpp.

Referenced by _timer_thread(), and resume_timer_procs().

Here is the caller graph for this function:

◆ _storage_thread()

void * VRBRAINScheduler::_storage_thread ( void *  arg)
staticprivate

Definition at line 387 of file Scheduler.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _timer_thread()

void * VRBRAINScheduler::_timer_thread ( void *  arg)
staticprivate

Definition at line 290 of file Scheduler.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _uart_thread()

void * VRBRAINScheduler::_uart_thread ( void *  arg)
staticprivate

Definition at line 344 of file Scheduler.cpp.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _uavcan_thread()

static void* VRBRAIN::VRBRAINScheduler::_uavcan_thread ( void *  arg)
staticprivate

Referenced by _storage_thread(), and create_uavcan_thread().

Here is the caller graph for this function:

◆ create_uavcan_thread()

void VRBRAINScheduler::create_uavcan_thread ( )
overridevirtual

Reimplemented from AP_HAL::Scheduler.

Definition at line 93 of file Scheduler.cpp.

Referenced by hal_initialized().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delay()

void VRBRAINScheduler::delay ( uint16_t  ms)
virtual

Implements AP_HAL::Scheduler.

Definition at line 174 of file Scheduler.cpp.

Referenced by reboot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ delay_microseconds()

void VRBRAINScheduler::delay_microseconds ( uint16_t  us)
virtual

Implements AP_HAL::Scheduler.

Definition at line 134 of file Scheduler.cpp.

Here is the call graph for this function:

◆ delay_microseconds_boost()

void VRBRAINScheduler::delay_microseconds_boost ( uint16_t  us)
virtual

Reimplemented from AP_HAL::Scheduler.

Definition at line 164 of file Scheduler.cpp.

Here is the call graph for this function:

◆ delay_microseconds_semaphore()

void VRBRAINScheduler::delay_microseconds_semaphore ( uint16_t  usec)
private

delay for a specified number of microseconds using a semaphore wait

Definition at line 124 of file Scheduler.cpp.

Referenced by _io_thread(), _storage_thread(), _timer_thread(), _uart_thread(), delay(), and delay_microseconds().

Here is the caller graph for this function:

◆ hal_initialized()

void VRBRAIN::VRBRAINScheduler::hal_initialized ( )
inline

Definition at line 62 of file Scheduler.h.

Referenced by main_loop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ in_main_thread()

bool VRBRAINScheduler::in_main_thread ( ) const
overridevirtual

Implements AP_HAL::Scheduler.

Definition at line 437 of file Scheduler.cpp.

Referenced by delay().

Here is the caller graph for this function:

◆ init()

void VRBRAINScheduler::init ( void  )
virtual

Implements AP_HAL::Scheduler.

Definition at line 45 of file Scheduler.cpp.

Here is the call graph for this function:

◆ reboot()

void VRBRAINScheduler::reboot ( bool  hold_in_bootloader)
virtual

Implements AP_HAL::Scheduler.

Definition at line 247 of file Scheduler.cpp.

Here is the call graph for this function:

◆ register_io_process()

void VRBRAINScheduler::register_io_process ( AP_HAL::MemberProc  proc)
virtual

Implements AP_HAL::Scheduler.

Definition at line 212 of file Scheduler.cpp.

Here is the call graph for this function:

◆ register_timer_failsafe()

void VRBRAINScheduler::register_timer_failsafe ( AP_HAL::Proc  failsafe,
uint32_t  period_us 
)
virtual

Implements AP_HAL::Scheduler.

Definition at line 228 of file Scheduler.cpp.

◆ register_timer_process()

void VRBRAINScheduler::register_timer_process ( AP_HAL::MemberProc  proc)
virtual

Implements AP_HAL::Scheduler.

Definition at line 196 of file Scheduler.cpp.

Here is the call graph for this function:

◆ resume_timer_procs()

void VRBRAINScheduler::resume_timer_procs ( )
virtual

Implements AP_HAL::Scheduler.

Definition at line 238 of file Scheduler.cpp.

Here is the call graph for this function:

◆ suspend_timer_procs()

void VRBRAINScheduler::suspend_timer_procs ( )
virtual

Implements AP_HAL::Scheduler.

Definition at line 233 of file Scheduler.cpp.

◆ system_initialized()

void VRBRAINScheduler::system_initialized ( )
virtual

Implements AP_HAL::Scheduler.

Definition at line 442 of file Scheduler.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _failsafe

AP_HAL::Proc VRBRAIN::VRBRAINScheduler::_failsafe
private

Definition at line 69 of file Scheduler.h.

Referenced by _run_timers(), and register_timer_failsafe().

◆ _hal_initialized

volatile bool VRBRAIN::VRBRAINScheduler::_hal_initialized
private

Definition at line 68 of file Scheduler.h.

Referenced by _io_thread(), _storage_thread(), _timer_thread(), _uart_thread(), and hal_initialized().

◆ _in_io_proc

volatile bool VRBRAIN::VRBRAINScheduler::_in_io_proc
private

Definition at line 79 of file Scheduler.h.

Referenced by _run_io().

◆ _in_timer_proc

volatile bool VRBRAIN::VRBRAINScheduler::_in_timer_proc
private

Definition at line 75 of file Scheduler.h.

Referenced by _run_timers().

◆ _initialized

bool VRBRAIN::VRBRAINScheduler::_initialized
private

Definition at line 67 of file Scheduler.h.

Referenced by system_initialized().

◆ _io_proc

AP_HAL::MemberProc VRBRAIN::VRBRAINScheduler::_io_proc[VRBRAIN_SCHEDULER_MAX_TIMER_PROCS]
private

Definition at line 77 of file Scheduler.h.

Referenced by _run_io(), and register_io_process().

◆ _io_thread_ctx

pthread_t VRBRAIN::VRBRAINScheduler::_io_thread_ctx
private

Definition at line 85 of file Scheduler.h.

Referenced by init().

◆ _main_task_pid

pid_t VRBRAIN::VRBRAINScheduler::_main_task_pid
private

Definition at line 83 of file Scheduler.h.

Referenced by in_main_thread(), and init().

◆ _num_io_procs

uint8_t VRBRAIN::VRBRAINScheduler::_num_io_procs
private

Definition at line 78 of file Scheduler.h.

Referenced by _run_io(), and register_io_process().

◆ _num_timer_procs

uint8_t VRBRAIN::VRBRAINScheduler::_num_timer_procs
private

Definition at line 74 of file Scheduler.h.

Referenced by _run_timers(), and register_timer_process().

◆ _perf_delay

perf_counter_t VRBRAIN::VRBRAINScheduler::_perf_delay
private

Definition at line 109 of file Scheduler.h.

Referenced by delay(), and delay_microseconds().

◆ _perf_io_timers

perf_counter_t VRBRAIN::VRBRAINScheduler::_perf_io_timers
private

Definition at line 107 of file Scheduler.h.

Referenced by _io_thread().

◆ _perf_storage_timer

perf_counter_t VRBRAIN::VRBRAINScheduler::_perf_storage_timer
private

Definition at line 108 of file Scheduler.h.

Referenced by _storage_thread().

◆ _perf_timers

perf_counter_t VRBRAIN::VRBRAINScheduler::_perf_timers
private

Definition at line 106 of file Scheduler.h.

Referenced by _timer_thread().

◆ _storage_thread_ctx

pthread_t VRBRAIN::VRBRAINScheduler::_storage_thread_ctx
private

Definition at line 86 of file Scheduler.h.

Referenced by init().

◆ _timer_event_missed

volatile bool VRBRAIN::VRBRAINScheduler::_timer_event_missed
private

Definition at line 81 of file Scheduler.h.

Referenced by _run_timers(), and resume_timer_procs().

◆ _timer_proc

AP_HAL::MemberProc VRBRAIN::VRBRAINScheduler::_timer_proc[VRBRAIN_SCHEDULER_MAX_TIMER_PROCS]
private

Definition at line 73 of file Scheduler.h.

Referenced by _run_timers(), and register_timer_process().

◆ _timer_suspended

volatile bool VRBRAIN::VRBRAINScheduler::_timer_suspended
private

Definition at line 71 of file Scheduler.h.

Referenced by _run_io(), _run_timers(), resume_timer_procs(), and suspend_timer_procs().

◆ _timer_thread_ctx

pthread_t VRBRAIN::VRBRAINScheduler::_timer_thread_ctx
private

Definition at line 84 of file Scheduler.h.

Referenced by init().

◆ _uart_thread_ctx

pthread_t VRBRAIN::VRBRAINScheduler::_uart_thread_ctx
private

Definition at line 87 of file Scheduler.h.

Referenced by init().

◆ _uavcan_thread_ctx

pthread_t VRBRAIN::VRBRAINScheduler::_uavcan_thread_ctx
private

Definition at line 88 of file Scheduler.h.

Referenced by create_uavcan_thread().


The documentation for this class was generated from the following files: