#include <Scheduler.h>
|
| 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_t * | get_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 () |
| |
Definition at line 167 of file Scheduler.h.
◆ IO_Completion
◆ ioc_proc
◆ Scheduler()
◆ _delay()
| void Scheduler::_delay |
( |
uint16_t |
ms | ) |
|
|
static |
◆ _delay_microseconds()
| void Scheduler::_delay_microseconds |
( |
uint16_t |
us | ) |
|
|
static |
◆ _delay_microseconds_boost()
| void Scheduler::_delay_microseconds_boost |
( |
uint16_t |
us | ) |
|
|
static |
◆ _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 |
◆ _go_next_task()
| void Scheduler::_go_next_task |
( |
| ) |
|
|
static |
◆ _in_main_thread()
| static bool F4Light::Scheduler::_in_main_thread |
( |
| ) |
|
|
inlinestatic |
◆ _ioc_timer_event()
| void Scheduler::_ioc_timer_event |
( |
uint32_t |
v | ) |
|
|
staticprivate |
◆ _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().
◆ _micros64()
| uint64_t Scheduler::_micros64 |
( |
| ) |
|
|
static |
◆ _millis()
| static uint32_t F4Light::Scheduler::_millis |
( |
| ) |
|
|
inlinestatic |
◆ _millis64()
| static uint64_t F4Light::Scheduler::_millis64 |
( |
| ) |
|
|
inlinestatic |
◆ _print_stats()
| void Scheduler::_print_stats |
( |
| ) |
|
|
staticprivate |
◆ _reboot()
| void Scheduler::_reboot |
( |
bool |
hold_in_bootloader | ) |
|
|
static |
◆ _register_io_process()
◆ _register_timer_process()
| static void F4Light::Scheduler::_register_timer_process |
( |
AP_HAL::MemberProc |
proc, |
|
|
uint32_t |
period |
|
) |
| |
|
inlinestatic |
◆ _register_timer_task()
◆ _run_io()
| void Scheduler::_run_io |
( |
void |
| ) |
|
|
staticprivate |
◆ _run_timer_procs()
| void Scheduler::_run_timer_procs |
( |
bool |
called_from_isr | ) |
|
|
staticprivate |
◆ _set_10s_flag()
| void Scheduler::_set_10s_flag |
( |
| ) |
|
|
staticprivate |
◆ _start_task()
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] | taskLoop | function to call. |
| [in] | stackSize | in bytes. |
- Returns
- address of TCB.
Definition at line 879 of file Scheduler.cpp.
Referenced by _register_timer_task(), hal_register_task(), and init().
◆ _stop_multitask()
| void Scheduler::_stop_multitask |
( |
| ) |
|
|
static |
◆ _switch_task()
| void Scheduler::_switch_task |
( |
| ) |
|
|
staticprotected |
◆ _tail_timer_event()
| void Scheduler::_tail_timer_event |
( |
uint32_t |
v | ) |
|
|
staticprivate |
◆ _timer5_ovf()
| void Scheduler::_timer5_ovf |
( |
uint32_t |
v | ) |
|
|
staticprivate |
◆ _timer_isr_event()
| void Scheduler::_timer_isr_event |
( |
uint32_t |
v | ) |
|
|
staticprivate |
◆ _try_kill_task_or_reboot()
| void Scheduler::_try_kill_task_or_reboot |
( |
uint8_t |
n | ) |
|
|
static |
◆ 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
-
- Returns
- bool.
Definition at line 253 of file Scheduler.h.
◆ adjust_timer_task()
◆ arming_state_changed()
| static void F4Light::Scheduler::arming_state_changed |
( |
bool |
v | ) |
|
|
inlinestatic |
◆ check_stack()
| void Scheduler::check_stack |
( |
uint32_t |
sp | ) |
|
|
staticprotected |
◆ context_switch_isr()
| static void F4Light::Scheduler::context_switch_isr |
( |
| ) |
|
|
inlinestatic |
◆ delay()
| void Scheduler::delay |
( |
uint16_t |
ms | ) |
|
|
inlinevirtual |
◆ delay_microseconds()
| void Scheduler::delay_microseconds |
( |
uint16_t |
us | ) |
|
|
inlinevirtual |
◆ delay_microseconds_boost()
| void F4Light::Scheduler::delay_microseconds_boost |
( |
uint16_t |
us | ) |
|
|
inlineoverridevirtual |
◆ dequeue_task()
| void Scheduler::dequeue_task |
( |
task_t & |
tp | ) |
|
|
staticprotected |
◆ do_io_completion()
| static void F4Light::Scheduler::do_io_completion |
( |
uint8_t |
id | ) |
|
|
inlinestatic |
◆ do_task()
| void Scheduler::do_task |
( |
task_t * |
task | ) |
|
|
staticprotected |
◆ enqueue_task()
| void Scheduler::enqueue_task |
( |
task_t & |
tp | ) |
|
|
staticprotected |
◆ exec_io_completion()
| static void F4Light::Scheduler::exec_io_completion |
( |
| ) |
|
|
static |
◆ fill_task()
| uint32_t Scheduler::fill_task |
( |
task_t & |
tp | ) |
|
|
staticprotected |
◆ get_current_task()
| static void* F4Light::Scheduler::get_current_task |
( |
| ) |
|
|
inlinestatic |
◆ get_current_task_isr()
| static void* F4Light::Scheduler::get_current_task_isr |
( |
| ) |
|
|
inlinestatic |
◆ get_empty_task()
| static task_t* F4Light::Scheduler::get_empty_task |
( |
| ) |
|
|
staticprotected |
◆ get_handler() [1/2]
| static Handler F4Light::Scheduler::get_handler |
( |
AP_HAL::MemberProc |
proc | ) |
|
|
inlinestatic |
◆ get_handler() [2/2]
◆ get_next_task()
| task_t * Scheduler::get_next_task |
( |
| ) |
|
|
static |
◆ in_interrupt()
| static bool F4Light::Scheduler::in_interrupt |
( |
| ) |
|
|
inlinestatic |
◆ in_main_thread()
| bool F4Light::Scheduler::in_main_thread |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ in_timerprocess()
| bool F4Light::Scheduler::in_timerprocess |
( |
| ) |
|
|
inline |
◆ init()
| void Scheduler::init |
( |
void |
| ) |
|
|
virtual |
◆ init_task()
| void * Scheduler::init_task |
( |
uint64_t |
h, |
|
|
const uint8_t * |
stack |
|
) |
| |
|
staticprotected |
◆ loop()
| void F4Light::Scheduler::loop |
( |
| ) |
|
◆ micros()
| uint32_t F4Light::Scheduler::micros |
( |
| ) |
|
|
inline |
◆ millis()
| uint32_t F4Light::Scheduler::millis |
( |
| ) |
|
|
inline |
◆ plan_context_switch()
| static void F4Light::Scheduler::plan_context_switch |
( |
| ) |
|
|
inlinestatic |
◆ reboot()
| void Scheduler::reboot |
( |
bool |
hold_in_bootloader | ) |
|
|
virtual |
◆ register_delay_callback()
| void Scheduler::register_delay_callback |
( |
AP_HAL::Proc |
proc, |
|
|
uint16_t |
min_time_ms |
|
) |
| |
|
overridevirtual |
◆ register_io_completion() [1/3]
| uint8_t Scheduler::register_io_completion |
( |
Handler |
handle | ) |
|
|
static |
◆ register_io_completion() [2/3]
| static uint8_t F4Light::Scheduler::register_io_completion |
( |
ioc_proc |
cb | ) |
|
|
inlinestatic |
◆ register_io_completion() [3/3]
| static uint8_t F4Light::Scheduler::register_io_completion |
( |
AP_HAL::MemberProc |
proc | ) |
|
|
inlinestatic |
◆ register_io_process()
| void Scheduler::register_io_process |
( |
AP_HAL::MemberProc |
proc | ) |
|
|
inlinevirtual |
◆ register_on_disarm()
| static void F4Light::Scheduler::register_on_disarm |
( |
Handler |
h | ) |
|
|
inlinestatic |
◆ register_timer_failsafe()
| void Scheduler::register_timer_failsafe |
( |
AP_HAL::Proc |
failsafe, |
|
|
uint32_t |
period_us |
|
) |
| |
|
inlinevirtual |
◆ register_timer_process()
| void Scheduler::register_timer_process |
( |
AP_HAL::MemberProc |
proc | ) |
|
|
inlinevirtual |
◆ register_timer_task()
◆ resume_boost()
| static void F4Light::Scheduler::resume_boost |
( |
| ) |
|
|
inlinestatic |
◆ resume_timer_procs()
| void Scheduler::resume_timer_procs |
( |
| ) |
|
|
inlinevirtual |
◆ set_task_active()
| static void F4Light::Scheduler::set_task_active |
( |
void * |
h | ) |
|
|
inlinestatic |
◆ set_task_period()
| void Scheduler::set_task_period |
( |
void * |
h, |
|
|
uint32_t |
period |
|
) |
| |
|
static |
◆ set_task_priority()
| static void F4Light::Scheduler::set_task_priority |
( |
void * |
h, |
|
|
uint8_t |
prio |
|
) |
| |
|
inlinestatic |
◆ set_task_semaphore()
◆ setEmergencyHandler()
| static void F4Light::Scheduler::setEmergencyHandler |
( |
voidFuncPtr |
handler | ) |
|
|
inlinestatic |
◆ start_stats_task()
| void Scheduler::start_stats_task |
( |
| ) |
|
|
static |
◆ start_task() [1/2]
◆ start_task() [2/2]
| static void* F4Light::Scheduler::start_task |
( |
AP_HAL::MemberProc |
proc, |
|
|
size_t |
stackSize = DEFAULT_STACK_SIZE |
|
) |
| |
|
inlinestatic |
◆ stop_task()
| void Scheduler::stop_task |
( |
void * |
h | ) |
|
|
static |
◆ suspend_timer_procs()
| void Scheduler::suspend_timer_procs |
( |
| ) |
|
|
inlinevirtual |
◆ SVC_Handler()
| void Scheduler::SVC_Handler |
( |
uint32_t * |
svc_args | ) |
|
|
static |
◆ switch_task()
| void Scheduler::switch_task |
( |
| ) |
|
|
staticprotected |
◆ system_initialized()
| void Scheduler::system_initialized |
( |
| ) |
|
|
virtual |
◆ task_pause()
| static void F4Light::Scheduler::task_pause |
( |
uint32_t |
t | ) |
|
|
inlinestatic |
◆ task_resume()
| static void F4Light::Scheduler::task_resume |
( |
void * |
h | ) |
|
|
inlinestatic |
◆ 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()
◆ yield()
| void Scheduler::yield |
( |
uint16_t |
ttw = 0 | ) |
|
|
static |
◆ _delay_cb_handle
| void* F4Light::Scheduler::_delay_cb_handle |
|
staticprivate |
◆ _failsafe
◆ _forced_task
| task_t* F4Light::Scheduler::_forced_task |
|
staticprotected |
◆ _idle_task
| task_t* F4Light::Scheduler::_idle_task |
|
staticprotected |
◆ _in_io_proc
| bool Scheduler::_in_io_proc = false |
|
staticprivate |
◆ _initialized
| bool F4Light::Scheduler::_initialized |
|
staticprivate |
◆ _io_proc
| AP_HAL::MemberProc Scheduler::_io_proc = {nullptr} |
|
staticprivate |
◆ _num_io_proc
| uint8_t F4Light::Scheduler::_num_io_proc |
|
staticprivate |
◆ boost_task
| void * Scheduler::boost_task |
|
staticprotected |
◆ delay_int_time
| uint64_t F4Light::Scheduler::delay_int_time |
|
staticprivate |
◆ delay_time
| uint64_t F4Light::Scheduler::delay_time |
|
staticprivate |
◆ flag_10s
| bool Scheduler::flag_10s = false |
|
staticprivate |
◆ io_completion
◆ ioc_time
| uint64_t F4Light::Scheduler::ioc_time |
|
staticprivate |
◆ lowest_stack
| uint32_t Scheduler::lowest_stack = (uint32_t)-1 |
|
staticprivate |
◆ max_delay_err
| uint32_t Scheduler::max_delay_err =0 |
|
staticprivate |
◆ max_loop_time
| uint32_t F4Light::Scheduler::max_loop_time |
|
staticprivate |
◆ max_wfe_time
| uint32_t F4Light::Scheduler::max_wfe_time |
|
staticprivate |
◆ need_io_completion
| volatile bool F4Light::Scheduler::need_io_completion |
|
static |
◆ need_switch_task
| volatile bool F4Light::Scheduler::need_switch_task |
|
static |
◆ num_io_completion
| uint8_t F4Light::Scheduler::num_io_completion |
|
staticprivate |
◆ on_disarm_handler
| Handler F4Light::Scheduler::on_disarm_handler |
|
staticprivate |
◆ s_main
| task_t Scheduler::s_main = { 0 } |
|
staticprotected |
◆ s_top
| size_t F4Light::Scheduler::s_top |
|
staticprotected |
◆ shed_time
| uint64_t Scheduler::shed_time = 0 |
|
staticprivate |
◆ sleep_time
| uint64_t F4Light::Scheduler::sleep_time |
|
staticprivate |
◆ task_n
| uint16_t Scheduler::task_n =0 |
|
staticprotected |
◆ task_time
| uint64_t F4Light::Scheduler::task_time |
|
staticprivate |
◆ tick_count
| uint32_t F4Light::Scheduler::tick_count |
|
staticprivate |
◆ tick_fulltime
| uint64_t F4Light::Scheduler::tick_fulltime |
|
staticprivate |
◆ tick_micros
| uint32_t F4Light::Scheduler::tick_micros |
|
staticprivate |
◆ timer5_ovf_cnt
| uint32_t F4Light::Scheduler::timer5_ovf_cnt |
|
staticprivate |
◆ tsched_count
| uint32_t F4Light::Scheduler::tsched_count |
|
staticprivate |
◆ tsched_count_t
| uint32_t F4Light::Scheduler::tsched_count_t |
|
staticprivate |
◆ tsched_count_y
| uint32_t F4Light::Scheduler::tsched_count_y |
|
staticprivate |
◆ tsched_sw_count
| uint32_t F4Light::Scheduler::tsched_sw_count |
|
staticprivate |
◆ tsched_sw_count_t
| uint32_t F4Light::Scheduler::tsched_sw_count_t |
|
staticprivate |
◆ tsched_sw_count_y
| uint32_t F4Light::Scheduler::tsched_sw_count_y |
|
staticprivate |
The documentation for this class was generated from the following files: