APM:Libraries
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
HALSITL::Scheduler Class Reference

#include <Scheduler.h>

Inheritance diagram for HALSITL::Scheduler:
[legend]
Collaboration diagram for HALSITL::Scheduler:
[legend]

Public Member Functions

 Scheduler (SITL_State *sitlState)
 
void init ()
 
void delay (uint16_t ms)
 
void delay_microseconds (uint16_t us)
 
void register_timer_process (AP_HAL::MemberProc)
 
void register_io_process (AP_HAL::MemberProc)
 
void suspend_timer_procs ()
 
void resume_timer_procs ()
 
void register_timer_failsafe (AP_HAL::Proc, uint32_t period_us)
 
bool in_main_thread () const override
 
void system_initialized ()
 
void reboot (bool hold_in_bootloader)
 
bool interrupts_are_blocked (void)
 
void sitl_begin_atomic ()
 
void sitl_end_atomic ()
 
uint64_t stopped_clock_usec () const
 
- Public Member Functions inherited from AP_HAL::Scheduler
 Scheduler ()
 
virtual void delay_microseconds_boost (uint16_t us)
 
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 create_uavcan_thread ()
 
virtual void * disable_interrupts_save (void)
 
virtual void restore_interrupts (void *)
 
virtual void call_delay_cb ()
 

Static Public Member Functions

static Schedulerfrom (AP_HAL::Scheduler *scheduler)
 
static void timer_event ()
 
static void _run_io_procs (bool called_from_isr)
 

Static Public Attributes

static bool _should_reboot = false
 

Private Member Functions

void stop_clock (uint64_t time_usec)
 

Static Private Member Functions

static void _run_timer_procs (bool called_from_isr)
 

Private Attributes

SITL_State_sitlState
 
uint8_t _nested_atomic_ctr
 
bool _initialized
 
uint64_t _stopped_clock_usec
 
uint64_t _last_io_run
 

Static Private Attributes

static AP_HAL::Proc _failsafe
 
static volatile bool _timer_suspended
 
static volatile bool _timer_event_missed
 
static AP_HAL::MemberProc _timer_proc [SITL_SCHEDULER_MAX_TIMER_PROCS]
 
static AP_HAL::MemberProc _io_proc [SITL_SCHEDULER_MAX_TIMER_PROCS]
 
static uint8_t _num_timer_procs
 
static uint8_t _num_io_procs
 
static bool _in_timer_proc
 
static bool _in_io_proc
 

Additional Inherited Members

- Public Attributes inherited from AP_HAL::Scheduler
uint16_t _min_delay_cb_ms
 

Detailed Description

Definition at line 11 of file Scheduler.h.

Constructor & Destructor Documentation

◆ Scheduler()

Scheduler::Scheduler ( SITL_State sitlState)
explicit

Definition at line 28 of file Scheduler.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _run_io_procs()

void Scheduler::_run_io_procs ( bool  called_from_isr)
static

Definition at line 176 of file Scheduler.cpp.

Referenced by HAL_SITL::run(), stop_clock(), stopped_clock_usec(), and timer_event().

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

◆ _run_timer_procs()

static void HALSITL::Scheduler::_run_timer_procs ( bool  called_from_isr)
staticprivate

Referenced by Scheduler(), sitl_end_atomic(), and timer_event().

Here is the caller graph for this function:

◆ delay()

void HALSITL::Scheduler::delay ( uint16_t  ms)
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ delay_microseconds()

void HALSITL::Scheduler::delay_microseconds ( uint16_t  us)
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ from()

static Scheduler* HALSITL::Scheduler::from ( AP_HAL::Scheduler scheduler)
inlinestatic

Definition at line 14 of file Scheduler.h.

Referenced by HALSITL::SITL_State::init().

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

◆ in_main_thread()

bool HALSITL::Scheduler::in_main_thread ( ) const
inlineoverridevirtual

Implements AP_HAL::Scheduler.

Definition at line 31 of file Scheduler.h.

Here is the call graph for this function:

◆ init()

void HALSITL::Scheduler::init ( )
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ interrupts_are_blocked()

bool HALSITL::Scheduler::interrupts_are_blocked ( void  )
inline

Definition at line 36 of file Scheduler.h.

Referenced by HALSITL::SITL_State::_fdm_input_step().

Here is the caller graph for this function:

◆ reboot()

void HALSITL::Scheduler::reboot ( bool  hold_in_bootloader)
virtual

Implements AP_HAL::Scheduler.

Referenced by in_main_thread(), and sitl_end_atomic().

Here is the caller graph for this function:

◆ register_io_process()

void HALSITL::Scheduler::register_io_process ( AP_HAL::MemberProc  )
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ register_timer_failsafe()

void HALSITL::Scheduler::register_timer_failsafe ( AP_HAL::Proc  ,
uint32_t  period_us 
)
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ register_timer_process()

void HALSITL::Scheduler::register_timer_process ( AP_HAL::MemberProc  )
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ resume_timer_procs()

void HALSITL::Scheduler::resume_timer_procs ( )
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ sitl_begin_atomic()

void HALSITL::Scheduler::sitl_begin_atomic ( )
inline

Definition at line 40 of file Scheduler.h.

Referenced by HALSITL::SITL_State::_fdm_input_step().

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

◆ sitl_end_atomic()

void Scheduler::sitl_end_atomic ( )

Definition at line 124 of file Scheduler.cpp.

Referenced by HALSITL::SITL_State::_fdm_input_step(), and sitl_begin_atomic().

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

◆ stop_clock()

void Scheduler::stop_clock ( uint64_t  time_usec)
privatevirtual

optional function to stop clock at a given time, used by log replay

Reimplemented from AP_HAL::Scheduler.

Definition at line 207 of file Scheduler.cpp.

Here is the call graph for this function:

◆ stopped_clock_usec()

uint64_t HALSITL::Scheduler::stopped_clock_usec ( ) const
inline

Definition at line 50 of file Scheduler.h.

Here is the call graph for this function:

◆ suspend_timer_procs()

void HALSITL::Scheduler::suspend_timer_procs ( )
virtual

Implements AP_HAL::Scheduler.

Referenced by from(), and Scheduler().

Here is the caller graph for this function:

◆ system_initialized()

void HALSITL::Scheduler::system_initialized ( )
virtual

Implements AP_HAL::Scheduler.

Referenced by in_main_thread(), and Scheduler().

Here is the caller graph for this function:

◆ timer_event()

static void HALSITL::Scheduler::timer_event ( )
inlinestatic

Definition at line 45 of file Scheduler.h.

Referenced by HALSITL::SITL_State::_fdm_input_step().

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

Member Data Documentation

◆ _failsafe

AP_HAL::Proc HALSITL::Scheduler::_failsafe
staticprivate

Definition at line 58 of file Scheduler.h.

Referenced by Scheduler(), and sitl_end_atomic().

◆ _in_io_proc

bool HALSITL::Scheduler::_in_io_proc
staticprivate

Definition at line 69 of file Scheduler.h.

Referenced by _run_io_procs(), and in_main_thread().

◆ _in_timer_proc

bool HALSITL::Scheduler::_in_timer_proc
staticprivate

Definition at line 68 of file Scheduler.h.

Referenced by in_main_thread(), and sitl_end_atomic().

◆ _initialized

bool HALSITL::Scheduler::_initialized
private

Definition at line 73 of file Scheduler.h.

Referenced by Scheduler().

◆ _io_proc

AP_HAL::MemberProc HALSITL::Scheduler::_io_proc[SITL_SCHEDULER_MAX_TIMER_PROCS]
staticprivate

Definition at line 65 of file Scheduler.h.

Referenced by _run_io_procs(), and Scheduler().

◆ _last_io_run

uint64_t HALSITL::Scheduler::_last_io_run
private

Definition at line 75 of file Scheduler.h.

Referenced by stop_clock().

◆ _nested_atomic_ctr

uint8_t HALSITL::Scheduler::_nested_atomic_ctr
private

Definition at line 57 of file Scheduler.h.

Referenced by interrupts_are_blocked(), sitl_begin_atomic(), and sitl_end_atomic().

◆ _num_io_procs

uint8_t HALSITL::Scheduler::_num_io_procs
staticprivate

Definition at line 67 of file Scheduler.h.

Referenced by _run_io_procs(), and Scheduler().

◆ _num_timer_procs

uint8_t HALSITL::Scheduler::_num_timer_procs
staticprivate

Definition at line 66 of file Scheduler.h.

Referenced by Scheduler(), and sitl_end_atomic().

◆ _should_reboot

bool Scheduler::_should_reboot = false
static

Definition at line 53 of file Scheduler.h.

Referenced by HAL_SITL::run(), and sitl_end_atomic().

◆ _sitlState

SITL_State* HALSITL::Scheduler::_sitlState
private

Definition at line 56 of file Scheduler.h.

Referenced by Scheduler().

◆ _stopped_clock_usec

uint64_t HALSITL::Scheduler::_stopped_clock_usec
private

Definition at line 74 of file Scheduler.h.

Referenced by stop_clock(), and stopped_clock_usec().

◆ _timer_event_missed

volatile bool HALSITL::Scheduler::_timer_event_missed
staticprivate

Definition at line 63 of file Scheduler.h.

Referenced by _run_io_procs(), Scheduler(), and sitl_end_atomic().

◆ _timer_proc

AP_HAL::MemberProc HALSITL::Scheduler::_timer_proc[SITL_SCHEDULER_MAX_TIMER_PROCS]
staticprivate

Definition at line 64 of file Scheduler.h.

Referenced by Scheduler(), and sitl_end_atomic().

◆ _timer_suspended

volatile bool HALSITL::Scheduler::_timer_suspended
staticprivate

Definition at line 62 of file Scheduler.h.

Referenced by _run_io_procs(), Scheduler(), and sitl_end_atomic().


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