APM:Libraries
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes | Static Private Member Functions | Static Private Attributes | List of all members
F4Light::Scheduler Class Reference

#include <Scheduler.h>

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

Classes

struct  IO_COMPLETION
 

Public Types

typedef struct F4Light::Scheduler::IO_COMPLETION IO_Completion
 
typedef voidFuncPtr ioc_proc
 

Public Member Functions

 Scheduler ()
 
void init ()
 
void delay (uint16_t ms)
 
void delay_microseconds (uint16_t us)
 
void delay_microseconds_boost (uint16_t us) override
 
uint32_t millis ()
 
uint32_t micros ()
 
void register_timer_process (AP_HAL::MemberProc proc)
 
void suspend_timer_procs ()
 
void resume_timer_procs ()
 
void register_delay_callback (AP_HAL::Proc, uint16_t min_time_ms) override
 
void register_io_process (AP_HAL::MemberProc proc)
 
bool in_timerprocess ()
 
void register_timer_failsafe (AP_HAL::Proc failsafe, uint32_t period_us)
 
void system_initialized ()
 
void reboot (bool hold_in_bootloader)
 
bool in_main_thread () const override
 
void loop ()
 
- Public Member Functions inherited from AP_HAL::Scheduler
 Scheduler ()
 
virtual void boost_end (void)
 
virtual bool in_delay_callback () const
 
virtual void stop_clock (uint64_t time_usec)
 
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 void _register_io_process (Handler h, Revo_IO_Flags flags)
 
static void _register_timer_process (AP_HAL::MemberProc proc, uint32_t period)
 
static void _reboot (bool hold_in_bootloader)
 
static AP_HAL::Device::PeriodicHandle register_timer_task (uint32_t period_us, AP_HAL::Device::PeriodicCb proc, F4Light::Semaphore *sem)
 
static void _delay (uint16_t ms)
 
static void _delay_microseconds (uint16_t us)
 
static void _delay_microseconds_boost (uint16_t us)
 
static void _delay_us_ny (uint16_t us)
 
static uint32_t _millis ()
 
static uint64_t _millis64 ()
 
static uint32_t _micros ()
 
static uint64_t _micros64 ()
 
static bool adjust_timer_task (AP_HAL::Device::PeriodicHandle h, uint32_t period_us)
 
static bool unregister_timer_task (AP_HAL::Device::PeriodicHandle h)
 
static bool in_interrupt ()
 
static bool adjust_stack (size_t stackSize)
 
static void * _start_task (Handler h, size_t stackSize)
 
static void * start_task (voidFuncPtr taskLoop, size_t stackSize=DEFAULT_STACK_SIZE)
 
static void * start_task (AP_HAL::MemberProc proc, size_t stackSize=DEFAULT_STACK_SIZE)
 
static void stop_task (void *h)
 
static void set_task_period (void *h, uint32_t period)
 
static void set_task_priority (void *h, uint8_t prio)
 
static void set_task_semaphore (void *h, F4Light::Semaphore *sem)
 
static void * get_current_task ()
 
static void * get_current_task_isr ()
 
static void set_task_active (void *h)
 
static void context_switch_isr ()
 
static void task_pause (uint32_t t)
 
static void task_resume (void *h)
 
static task_tget_next_task ()
 
static void yield (uint16_t ttw=0)
 
static size_t task_stack ()
 
static bool _in_main_thread ()
 
static void resume_boost ()
 
static void plan_context_switch ()
 
static void SVC_Handler (uint32_t *svc_args)
 
static void _try_kill_task_or_reboot (uint8_t n)
 
static void _go_next_task ()
 
static void _stop_multitask ()
 
static uint8_t register_io_completion (Handler handle)
 
static uint8_t register_io_completion (ioc_proc cb)
 
static uint8_t register_io_completion (AP_HAL::MemberProc proc)
 
static void do_io_completion (uint8_t id)
 
static void exec_io_completion ()
 
static Handler get_handler (AP_HAL::MemberProc proc)
 
static Handler get_handler (AP_HAL::Proc proc)
 
static void setEmergencyHandler (voidFuncPtr handler)
 
static void arming_state_changed (bool v)
 
static void register_on_disarm (Handler h)
 
static void start_stats_task ()
 

Static Public Attributes

static volatile bool need_switch_task
 
static volatile bool need_io_completion
 

Static Protected Member Functions

static void do_task (task_t *task)
 
static task_tget_empty_task ()
 
static void * init_task (uint64_t h, const uint8_t *stack)
 
static uint32_t fill_task (task_t &tp)
 
static void enqueue_task (task_t &tp)
 
static void dequeue_task (task_t &tp)
 
static void switch_task ()
 
static void _switch_task ()
 
static void check_stack (uint32_t sp)
 

Static Protected Attributes

static task_t s_main = { 0 }
 
static size_t s_top
 
static uint16_t task_n =0
 
static task_t_idle_task
 
static task_t_forced_task
 
static void * boost_task
 

Static Private Member Functions

static AP_HAL::Device::PeriodicHandle _register_timer_task (uint32_t period_us, Handler proc, F4Light::Semaphore *sem)
 
static void _timer_isr_event (uint32_t v)
 
static void _timer5_ovf (uint32_t v)
 
static void _tail_timer_event (uint32_t v)
 
static void _ioc_timer_event (uint32_t v)
 
static void _delay_timer_event (uint32_t v)
 
static void _run_timer_procs (bool called_from_isr)
 
static void _run_io (void)
 
static void _print_stats ()
 
static void _set_10s_flag ()
 

Static Private Attributes

static void * _delay_cb_handle
 
static bool _initialized
 
static uint32_t timer5_ovf_cnt
 
static AP_HAL::Proc _failsafe = nullptr
 
static Revo_IO _io_proc [F4Light_SCHEDULER_MAX_IO_PROCS] = {nullptr}
 
static uint8_t _num_io_proc
 
static bool _in_io_proc = false
 
static Handler on_disarm_handler
 
static uint32_t lowest_stack = (uint32_t)-1
 
static struct IO_COMPLETION io_completion [MAX_IO_COMPLETION]
 
static uint8_t num_io_completion
 
static uint64_t shed_time = 0
 
static uint64_t task_time
 
static bool flag_10s = false
 
static uint64_t delay_time
 
static uint64_t delay_int_time
 
static uint32_t max_loop_time
 
static uint64_t ioc_time
 
static uint64_t sleep_time
 
static uint32_t max_delay_err =0
 
static uint32_t tick_micros
 
static uint32_t tick_count
 
static uint64_t tick_fulltime
 
static uint32_t max_wfe_time
 
static uint32_t tsched_count
 
static uint32_t tsched_sw_count
 
static uint32_t tsched_count_y
 
static uint32_t tsched_sw_count_y
 
static uint32_t tsched_count_t
 
static uint32_t tsched_sw_count_t
 

Additional Inherited Members

- Public Attributes inherited from AP_HAL::Scheduler
uint16_t _min_delay_cb_ms
 

Detailed Description

Definition at line 167 of file Scheduler.h.

Member Typedef Documentation

◆ IO_Completion

◆ ioc_proc

Definition at line 409 of file Scheduler.h.

Constructor & Destructor Documentation

◆ Scheduler()

Scheduler::Scheduler ( )

Definition at line 116 of file Scheduler.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _delay()

void Scheduler::_delay ( uint16_t  ms)
static

Definition at line 258 of file Scheduler.cpp.

Referenced by _reboot(), AP_HAL::delay(), hal_delay(), and F4Light::DSM_parser::init().

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

◆ _delay_microseconds()

void Scheduler::_delay_microseconds ( uint16_t  us)
static

Definition at line 305 of file Scheduler.cpp.

Referenced by AP_HAL::delay_microseconds(), hal_delay_microseconds(), F4Light::DSM_parser::init(), and F4Light::AnalogSource::setup_read().

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

◆ _delay_microseconds_boost()

void Scheduler::_delay_microseconds_boost ( uint16_t  us)
static

Definition at line 287 of file Scheduler.cpp.

Here is the call graph for this function:

◆ _delay_timer_event()

static void F4Light::Scheduler::_delay_timer_event ( uint32_t  v)
staticprivate

◆ _delay_us_ny()

void Scheduler::_delay_us_ny ( uint16_t  us)
static

Definition at line 329 of file Scheduler.cpp.

Referenced by _delay_microseconds().

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

◆ _go_next_task()

void Scheduler::_go_next_task ( )
static

Definition at line 949 of file Scheduler.cpp.

Referenced by hal_go_next_task().

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

◆ _in_main_thread()

static bool F4Light::Scheduler::_in_main_thread ( )
inlinestatic

Definition at line 365 of file Scheduler.h.

Referenced by _start_task().

Here is the caller graph for this function:

◆ _ioc_timer_event()

void Scheduler::_ioc_timer_event ( uint32_t  v)
staticprivate

Definition at line 1229 of file Scheduler.cpp.

Referenced by init().

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

◆ _micros()

static uint32_t F4Light::Scheduler::_micros ( )
inlinestatic

Definition at line 232 of file Scheduler.h.

Referenced by _delay(), _delay_microseconds(), _delay_microseconds_boost(), _ioc_timer_event(), _micros64(), F4Light::Semaphore::_take_nonblocking(), _timer_isr_event(), AP_HAL::cond_yield(), do_task(), fill_task(), get_next_task(), hal_micros(), F4Light::I2CDevice::i2c_read(), F4Light::I2CDevice::isr_ev(), set_task_period(), SVC_Handler(), F4Light::Semaphore::take(), F4Light::I2CDevice::transfer(), and F4Light::USBDriver::write().

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

◆ _micros64()

uint64_t Scheduler::_micros64 ( )
static

Definition at line 492 of file Scheduler.cpp.

Referenced by AP_HAL::cond_yield(), and F4Light::Util::set_system_clock().

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

◆ _millis()

static uint32_t F4Light::Scheduler::_millis ( )
inlinestatic

Definition at line 229 of file Scheduler.h.

Referenced by _print_stats(), _run_timer_procs(), and AP_HAL::cond_yield().

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

◆ _millis64()

static uint64_t F4Light::Scheduler::_millis64 ( )
inlinestatic

Definition at line 230 of file Scheduler.h.

Referenced by AP_HAL::cond_yield().

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

◆ _print_stats()

void Scheduler::_print_stats ( )
staticprivate

Definition at line 558 of file Scheduler.cpp.

Referenced by _set_10s_flag().

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

◆ _reboot()

void Scheduler::_reboot ( bool  hold_in_bootloader)
static

Definition at line 521 of file Scheduler.cpp.

Referenced by _try_kill_task_or_reboot(), and reboot().

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

◆ _register_io_process()

void Scheduler::_register_io_process ( Handler  h,
Revo_IO_Flags  flags 
)
static

Definition at line 391 of file Scheduler.cpp.

Referenced by F4Light::I2CDevice::transfer().

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

◆ _register_timer_process()

static void F4Light::Scheduler::_register_timer_process ( AP_HAL::MemberProc  proc,
uint32_t  period 
)
inlinestatic

Definition at line 200 of file Scheduler.h.

◆ _register_timer_task()

AP_HAL::Device::PeriodicHandle Scheduler::_register_timer_task ( uint32_t  period_us,
Handler  proc,
F4Light::Semaphore sem 
)
staticprivate

Definition at line 692 of file Scheduler.cpp.

Referenced by start_stats_task().

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

◆ _run_io()

void Scheduler::_run_io ( void  )
staticprivate

Definition at line 370 of file Scheduler.cpp.

Referenced by _register_io_process().

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

◆ _run_timer_procs()

void Scheduler::_run_timer_procs ( bool  called_from_isr)
staticprivate

Definition at line 439 of file Scheduler.cpp.

Referenced by _timer_isr_event().

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

◆ _set_10s_flag()

void Scheduler::_set_10s_flag ( )
staticprivate

Definition at line 682 of file Scheduler.cpp.

Referenced by start_stats_task().

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

◆ _start_task()

void *NOINLINE Scheduler::_start_task ( Handler  h,
size_t  stackSize 
)
static

Start a task with given function and stack size. Should be called from main task. The functions are executed by the task. The taskLoop function is repeatedly called. Returns not-NULL if successful otherwise NULL (no memory for new task).

Parameters
[in]taskLoopfunction to call.
[in]stackSizein bytes.
Returns
address of TCB.

Definition at line 879 of file Scheduler.cpp.

Referenced by _register_timer_task(), hal_register_task(), and init().

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

◆ _stop_multitask()

void Scheduler::_stop_multitask ( )
static

Definition at line 955 of file Scheduler.cpp.

Referenced by hal_stop_multitask().

Here is the caller graph for this function:

◆ _switch_task()

void Scheduler::_switch_task ( )
staticprotected

Definition at line 1386 of file Scheduler.cpp.

Referenced by _tail_timer_event(), _timer_isr_event(), and switch_task().

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

◆ _tail_timer_event()

void Scheduler::_tail_timer_event ( uint32_t  v)
staticprivate

Definition at line 1166 of file Scheduler.cpp.

Referenced by init().

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

◆ _timer5_ovf()

void Scheduler::_timer5_ovf ( uint32_t  v)
staticprivate

Definition at line 488 of file Scheduler.cpp.

Referenced by init().

Here is the caller graph for this function:

◆ _timer_isr_event()

void Scheduler::_timer_isr_event ( uint32_t  v)
staticprivate

Definition at line 453 of file Scheduler.cpp.

Referenced by init().

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

◆ _try_kill_task_or_reboot()

void Scheduler::_try_kill_task_or_reboot ( uint8_t  n)
static

Definition at line 932 of file Scheduler.cpp.

Referenced by hal_try_kill_task_or_reboot().

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

◆ adjust_stack()

static bool F4Light::Scheduler::adjust_stack ( size_t  stackSize)
inlinestatic

Initiate scheduler and main task with given stack size. Should be called before start of any tasks if the main task requires a stack size other than the default size. Returns true if successful otherwise false.

Parameters
[in]stackSizein bytes.
Returns
bool.

Definition at line 253 of file Scheduler.h.

◆ adjust_timer_task()

bool Scheduler::adjust_timer_task ( AP_HAL::Device::PeriodicHandle  h,
uint32_t  period_us 
)
static

Definition at line 707 of file Scheduler.cpp.

Referenced by F4Light::I2CDevice::adjust_periodic_callback(), and F4Light::SPIDevice::adjust_periodic_callback().

Here is the caller graph for this function:

◆ arming_state_changed()

static void F4Light::Scheduler::arming_state_changed ( bool  v)
inlinestatic

Definition at line 459 of file Scheduler.h.

Referenced by F4Light::Util::set_soft_armed().

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

◆ check_stack()

void Scheduler::check_stack ( uint32_t  sp)
staticprotected

Definition at line 417 of file Scheduler.cpp.

Referenced by _timer_isr_event().

Here is the caller graph for this function:

◆ context_switch_isr()

static void F4Light::Scheduler::context_switch_isr ( )
inlinestatic

Definition at line 312 of file Scheduler.h.

Referenced by F4Light::Semaphore::give(), and hal_context_switch_isr().

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

◆ delay()

void Scheduler::delay ( uint16_t  ms)
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 184 of file Scheduler.h.

◆ delay_microseconds()

void Scheduler::delay_microseconds ( uint16_t  us)
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 185 of file Scheduler.h.

◆ delay_microseconds_boost()

void F4Light::Scheduler::delay_microseconds_boost ( uint16_t  us)
inlineoverridevirtual

Reimplemented from AP_HAL::Scheduler.

Definition at line 186 of file Scheduler.h.

◆ dequeue_task()

void Scheduler::dequeue_task ( task_t tp)
staticprotected

Definition at line 808 of file Scheduler.cpp.

Referenced by get_next_task().

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

◆ do_io_completion()

static void F4Light::Scheduler::do_io_completion ( uint8_t  id)
inlinestatic

Definition at line 422 of file Scheduler.h.

Referenced by F4Light::DSM_parser::init(), and F4Light::PPM_parser::start_ioc().

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

◆ do_task()

void Scheduler::do_task ( task_t task)
staticprotected

Definition at line 763 of file Scheduler.cpp.

Referenced by init_task().

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

◆ enqueue_task()

void Scheduler::enqueue_task ( task_t tp)
staticprotected

Definition at line 797 of file Scheduler.cpp.

Referenced by _start_task().

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

◆ exec_io_completion()

static void F4Light::Scheduler::exec_io_completion ( )
static

◆ fill_task()

uint32_t Scheduler::fill_task ( task_t tp)
staticprotected

Definition at line 817 of file Scheduler.cpp.

Referenced by init_task().

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

◆ get_current_task()

static void* F4Light::Scheduler::get_current_task ( )
inlinestatic

Definition at line 299 of file Scheduler.h.

Referenced by _delay_microseconds_boost(), F4Light::SPIDevice::do_transfer(), F4Light::I2CDevice::i2c_read(), F4Light::I2CDevice::i2c_write(), and F4Light::SPIDevice::wait_for().

Here is the caller graph for this function:

◆ get_current_task_isr()

static void* F4Light::Scheduler::get_current_task_isr ( )
inlinestatic

Definition at line 303 of file Scheduler.h.

Referenced by F4Light::Semaphore::_take_nonblocking(), F4Light::Semaphore::svc_take(), and F4Light::Semaphore::svc_take_nonblocking().

Here is the caller graph for this function:

◆ get_empty_task()

static task_t* F4Light::Scheduler::get_empty_task ( )
staticprotected

Referenced by unregister_timer_task().

Here is the caller graph for this function:

◆ get_handler() [1/2]

static Handler F4Light::Scheduler::get_handler ( AP_HAL::MemberProc  proc)
inlinestatic

Definition at line 436 of file Scheduler.h.

Referenced by F4Light::UARTDriver::begin(), F4Light::I2CDevice::i2c_read(), F4Light::I2CDevice::i2c_write(), F4Light::Storage::late_init(), F4Light::SPIDevice::send_strobe(), F4Light::SPIDevice::setup_dma_transfer(), F4Light::SPIDevice::setup_isr_transfer(), and F4Light::SPIDevice::wait_for().

Here is the caller graph for this function:

◆ get_handler() [2/2]

static Handler F4Light::Scheduler::get_handler ( AP_HAL::Proc  proc)
inlinestatic

Definition at line 440 of file Scheduler.h.

◆ get_next_task()

task_t * Scheduler::get_next_task ( )
static

Definition at line 961 of file Scheduler.cpp.

Referenced by _switch_task(), _tail_timer_event(), _timer_isr_event(), and _try_kill_task_or_reboot().

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

◆ in_interrupt()

static bool F4Light::Scheduler::in_interrupt ( )
inlinestatic

Definition at line 240 of file Scheduler.h.

Referenced by _start_task(), F4Light::Semaphore::give(), init(), F4Light::Semaphore::take(), and yield().

Here is the caller graph for this function:

◆ in_main_thread()

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

Implements AP_HAL::Scheduler.

Definition at line 215 of file Scheduler.h.

◆ in_timerprocess()

bool F4Light::Scheduler::in_timerprocess ( )
inline

Definition at line 206 of file Scheduler.h.

◆ init()

void Scheduler::init ( void  )
virtual

Implements AP_HAL::Scheduler.

Definition at line 155 of file Scheduler.cpp.

Here is the call graph for this function:

◆ init_task()

void * Scheduler::init_task ( uint64_t  h,
const uint8_t *  stack 
)
staticprotected

Definition at line 833 of file Scheduler.cpp.

Referenced by _start_task().

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

◆ loop()

void F4Light::Scheduler::loop ( )

◆ micros()

uint32_t F4Light::Scheduler::micros ( )
inline

Definition at line 189 of file Scheduler.h.

◆ millis()

uint32_t F4Light::Scheduler::millis ( )
inline

Definition at line 188 of file Scheduler.h.

Here is the call graph for this function:

◆ plan_context_switch()

static void F4Light::Scheduler::plan_context_switch ( )
inlinestatic

Definition at line 391 of file Scheduler.h.

Referenced by _go_next_task(), _switch_task(), _tail_timer_event(), and _timer_isr_event().

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

◆ reboot()

void Scheduler::reboot ( bool  hold_in_bootloader)
virtual

Implements AP_HAL::Scheduler.

Definition at line 542 of file Scheduler.cpp.

Here is the call graph for this function:

◆ register_delay_callback()

void Scheduler::register_delay_callback ( AP_HAL::Proc  proc,
uint16_t  min_time_ms 
)
overridevirtual

Reimplemented from AP_HAL::Scheduler.

Definition at line 345 of file Scheduler.cpp.

Here is the call graph for this function:

◆ register_io_completion() [1/3]

uint8_t Scheduler::register_io_completion ( Handler  handle)
static

Definition at line 1219 of file Scheduler.cpp.

Referenced by F4Light::DSM_parser::init(), and F4Light::PPM_parser::init().

Here is the caller graph for this function:

◆ register_io_completion() [2/3]

static uint8_t F4Light::Scheduler::register_io_completion ( ioc_proc  cb)
inlinestatic

Definition at line 413 of file Scheduler.h.

◆ register_io_completion() [3/3]

static uint8_t F4Light::Scheduler::register_io_completion ( AP_HAL::MemberProc  proc)
inlinestatic

Definition at line 417 of file Scheduler.h.

◆ register_io_process()

void Scheduler::register_io_process ( AP_HAL::MemberProc  proc)
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 197 of file Scheduler.h.

◆ register_on_disarm()

static void F4Light::Scheduler::register_on_disarm ( Handler  h)
inlinestatic

Definition at line 460 of file Scheduler.h.

Referenced by F4Light::Storage::late_init().

Here is the caller graph for this function:

◆ register_timer_failsafe()

void Scheduler::register_timer_failsafe ( AP_HAL::Proc  failsafe,
uint32_t  period_us 
)
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 208 of file Scheduler.h.

◆ register_timer_process()

void Scheduler::register_timer_process ( AP_HAL::MemberProc  proc)
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 191 of file Scheduler.h.

◆ register_timer_task()

static AP_HAL::Device::PeriodicHandle F4Light::Scheduler::register_timer_task ( uint32_t  period_us,
AP_HAL::Device::PeriodicCb  proc,
F4Light::Semaphore sem 
)
inlinestatic

Definition at line 218 of file Scheduler.h.

Referenced by F4Light::I2CDevice::register_periodic_callback(), and F4Light::SPIDevice::register_periodic_callback().

Here is the caller graph for this function:

◆ resume_boost()

static void F4Light::Scheduler::resume_boost ( )
inlinestatic

Definition at line 368 of file Scheduler.h.

Here is the call graph for this function:

◆ resume_timer_procs()

void Scheduler::resume_timer_procs ( )
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 193 of file Scheduler.h.

◆ set_task_active()

static void F4Light::Scheduler::set_task_active ( void *  h)
inlinestatic

Definition at line 306 of file Scheduler.h.

Referenced by hal_set_task_active(), init(), and F4Light::Storage::write_word().

Here is the caller graph for this function:

◆ set_task_period()

void Scheduler::set_task_period ( void *  h,
uint32_t  period 
)
static

Definition at line 914 of file Scheduler.cpp.

Referenced by _register_io_process(), _register_timer_task(), and F4Light::AnalogIn::init().

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

◆ set_task_priority()

static void F4Light::Scheduler::set_task_priority ( void *  h,
uint8_t  prio 
)
inlinestatic

Definition at line 282 of file Scheduler.h.

Referenced by _register_io_process(), _register_timer_task(), hal_set_task_priority(), F4Light::Storage::init(), F4Light::AnalogIn::init(), init(), and start_stats_task().

Here is the caller graph for this function:

◆ set_task_semaphore()

static void F4Light::Scheduler::set_task_semaphore ( void *  h,
F4Light::Semaphore sem 
)
inlinestatic

Definition at line 290 of file Scheduler.h.

Referenced by _register_timer_task().

Here is the caller graph for this function:

◆ setEmergencyHandler()

static void F4Light::Scheduler::setEmergencyHandler ( voidFuncPtr  handler)
inlinestatic

Definition at line 445 of file Scheduler.h.

◆ start_stats_task()

void Scheduler::start_stats_task ( )
static

Definition at line 244 of file Scheduler.cpp.

Here is the call graph for this function:

◆ start_task() [1/2]

static void* F4Light::Scheduler::start_task ( voidFuncPtr  taskLoop,
size_t  stackSize = DEFAULT_STACK_SIZE 
)
inlinestatic

Definition at line 266 of file Scheduler.h.

Referenced by _register_io_process(), F4Light::Storage::init(), and F4Light::AnalogIn::init().

Here is the caller graph for this function:

◆ start_task() [2/2]

static void* F4Light::Scheduler::start_task ( AP_HAL::MemberProc  proc,
size_t  stackSize = DEFAULT_STACK_SIZE 
)
inlinestatic

Definition at line 270 of file Scheduler.h.

◆ stop_task()

void Scheduler::stop_task ( void *  h)
static

Definition at line 752 of file Scheduler.cpp.

Referenced by _try_kill_task_or_reboot().

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

◆ suspend_timer_procs()

void Scheduler::suspend_timer_procs ( )
inlinevirtual

Implements AP_HAL::Scheduler.

Definition at line 192 of file Scheduler.h.

◆ SVC_Handler()

void Scheduler::SVC_Handler ( uint32_t *  svc_args)
static

Definition at line 1309 of file Scheduler.cpp.

Referenced by SVC_Handler().

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

◆ switch_task()

void Scheduler::switch_task ( )
staticprotected

Definition at line 1380 of file Scheduler.cpp.

Referenced by SVC_Handler().

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

◆ system_initialized()

void Scheduler::system_initialized ( )
virtual

Implements AP_HAL::Scheduler.

Definition at line 508 of file Scheduler.cpp.

Here is the call graph for this function:

◆ task_pause()

static void F4Light::Scheduler::task_pause ( uint32_t  t)
inlinestatic

Definition at line 316 of file Scheduler.h.

Referenced by F4Light::SPIDevice::do_transfer(), F4Light::I2CDevice::i2c_read(), F4Light::I2CDevice::i2c_write(), and F4Light::SPIDevice::wait_for().

Here is the caller graph for this function:

◆ task_resume()

static void F4Light::Scheduler::task_resume ( void *  h)
inlinestatic

Definition at line 321 of file Scheduler.h.

Referenced by F4Light::I2CDevice::finish_transfer(), and F4Light::SPIDevice::isr_transfer_finish().

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

◆ task_stack()

size_t Scheduler::task_stack ( )
static

Return current task stack size.

Returns
bytes

Definition at line 1209 of file Scheduler.cpp.

◆ unregister_timer_task()

bool Scheduler::unregister_timer_task ( AP_HAL::Device::PeriodicHandle  h)
static

Definition at line 718 of file Scheduler.cpp.

Referenced by F4Light::I2CDevice::unregister_callback(), and F4Light::SPIDevice::unregister_callback().

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

◆ yield()

void Scheduler::yield ( uint16_t  ttw = 0)
static

Definition at line 1188 of file Scheduler.cpp.

Referenced by _delay(), _delay_microseconds(), _delay_microseconds_boost(), AP_HAL::cond_yield(), do_task(), hal_yield(), idle_task(), and AP_HAL::yield().

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

Member Data Documentation

◆ _delay_cb_handle

void* F4Light::Scheduler::_delay_cb_handle
staticprivate

Definition at line 505 of file Scheduler.h.

◆ _failsafe

AP_HAL::Proc Scheduler::_failsafe = nullptr
staticprivate

Definition at line 519 of file Scheduler.h.

Referenced by _run_timer_procs().

◆ _forced_task

task_t* F4Light::Scheduler::_forced_task
staticprotected

Definition at line 493 of file Scheduler.h.

Referenced by get_next_task(), and Scheduler().

◆ _idle_task

task_t* F4Light::Scheduler::_idle_task
staticprotected

Definition at line 492 of file Scheduler.h.

Referenced by _switch_task(), get_next_task(), and init().

◆ _in_io_proc

bool Scheduler::_in_io_proc = false
staticprivate

Definition at line 524 of file Scheduler.h.

Referenced by _run_io().

◆ _initialized

bool F4Light::Scheduler::_initialized
staticprivate

Definition at line 506 of file Scheduler.h.

Referenced by system_initialized().

◆ _io_proc

AP_HAL::MemberProc Scheduler::_io_proc = {nullptr}
staticprivate

Definition at line 521 of file Scheduler.h.

Referenced by _register_io_process(), _run_io(), and init().

◆ _num_io_proc

uint8_t F4Light::Scheduler::_num_io_proc
staticprivate

Definition at line 523 of file Scheduler.h.

Referenced by _register_io_process(), and _run_io().

◆ boost_task

void * Scheduler::boost_task
staticprotected

Definition at line 494 of file Scheduler.h.

Referenced by _delay_microseconds_boost().

◆ delay_int_time

uint64_t F4Light::Scheduler::delay_int_time
staticprivate

Definition at line 542 of file Scheduler.h.

Referenced by _print_stats().

◆ delay_time

uint64_t F4Light::Scheduler::delay_time
staticprivate

◆ flag_10s

bool Scheduler::flag_10s = false
staticprivate

Definition at line 539 of file Scheduler.h.

Referenced by _print_stats(), and _set_10s_flag().

◆ io_completion

struct IO_COMPLETION F4Light::Scheduler::io_completion[MAX_IO_COMPLETION]
staticprivate

Definition at line 532 of file Scheduler.h.

Referenced by _ioc_timer_event(), _print_stats(), init(), and register_io_completion().

◆ ioc_time

uint64_t F4Light::Scheduler::ioc_time
staticprivate

Definition at line 546 of file Scheduler.h.

Referenced by _ioc_timer_event(), and _print_stats().

◆ lowest_stack

uint32_t Scheduler::lowest_stack = (uint32_t)-1
staticprivate

Definition at line 530 of file Scheduler.h.

Referenced by _print_stats(), and check_stack().

◆ max_delay_err

uint32_t Scheduler::max_delay_err =0
staticprivate

Definition at line 548 of file Scheduler.h.

◆ max_loop_time

uint32_t F4Light::Scheduler::max_loop_time
staticprivate

Definition at line 543 of file Scheduler.h.

Referenced by _print_stats().

◆ max_wfe_time

uint32_t F4Light::Scheduler::max_wfe_time
staticprivate

Definition at line 558 of file Scheduler.h.

◆ need_io_completion

volatile bool F4Light::Scheduler::need_io_completion
static

Definition at line 431 of file Scheduler.h.

◆ need_switch_task

volatile bool F4Light::Scheduler::need_switch_task
static

Definition at line 402 of file Scheduler.h.

Referenced by _switch_task(), _tail_timer_event(), _timer_isr_event(), and PendSV_Handler().

◆ num_io_completion

uint8_t F4Light::Scheduler::num_io_completion
staticprivate

Definition at line 533 of file Scheduler.h.

Referenced by _ioc_timer_event(), _print_stats(), and register_io_completion().

◆ on_disarm_handler

Handler F4Light::Scheduler::on_disarm_handler
staticprivate

Definition at line 526 of file Scheduler.h.

◆ s_main

task_t Scheduler::s_main = { 0 }
staticprotected

◆ s_top

size_t F4Light::Scheduler::s_top
staticprotected

Definition at line 489 of file Scheduler.h.

Referenced by _start_task(), and Scheduler().

◆ shed_time

uint64_t Scheduler::shed_time = 0
staticprivate

Definition at line 537 of file Scheduler.h.

Referenced by _print_stats().

◆ sleep_time

uint64_t F4Light::Scheduler::sleep_time
staticprivate

Definition at line 547 of file Scheduler.h.

◆ task_n

uint16_t Scheduler::task_n =0
staticprotected

◆ task_time

uint64_t F4Light::Scheduler::task_time
staticprivate

Definition at line 538 of file Scheduler.h.

Referenced by _print_stats().

◆ tick_count

uint32_t F4Light::Scheduler::tick_count
staticprivate

Definition at line 552 of file Scheduler.h.

◆ tick_fulltime

uint64_t F4Light::Scheduler::tick_fulltime
staticprivate

Definition at line 553 of file Scheduler.h.

◆ tick_micros

uint32_t F4Light::Scheduler::tick_micros
staticprivate

Definition at line 551 of file Scheduler.h.

◆ timer5_ovf_cnt

uint32_t F4Light::Scheduler::timer5_ovf_cnt
staticprivate

Definition at line 517 of file Scheduler.h.

Referenced by _micros64(), and _timer5_ovf().

◆ tsched_count

uint32_t F4Light::Scheduler::tsched_count
staticprivate

Definition at line 559 of file Scheduler.h.

Referenced by _print_stats(), and _timer_isr_event().

◆ tsched_count_t

uint32_t F4Light::Scheduler::tsched_count_t
staticprivate

Definition at line 563 of file Scheduler.h.

Referenced by _print_stats(), and _tail_timer_event().

◆ tsched_count_y

uint32_t F4Light::Scheduler::tsched_count_y
staticprivate

Definition at line 561 of file Scheduler.h.

Referenced by _print_stats(), and _switch_task().

◆ tsched_sw_count

uint32_t F4Light::Scheduler::tsched_sw_count
staticprivate

Definition at line 560 of file Scheduler.h.

Referenced by _print_stats(), and _timer_isr_event().

◆ tsched_sw_count_t

uint32_t F4Light::Scheduler::tsched_sw_count_t
staticprivate

Definition at line 564 of file Scheduler.h.

Referenced by _print_stats(), and _tail_timer_event().

◆ tsched_sw_count_y

uint32_t F4Light::Scheduler::tsched_sw_count_y
staticprivate

Definition at line 562 of file Scheduler.h.

Referenced by _print_stats(), and _switch_task().


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