#include <scheduler.hpp>
Classes | |
struct | InsideSpinSetter |
Public Member Functions | |
MonotonicDuration | getCleanupPeriod () const |
MonotonicDuration | getDeadlineResolution () const |
DeadlineScheduler & | getDeadlineScheduler () |
Dispatcher & | getDispatcher () |
const Dispatcher & | getDispatcher () const |
MonotonicTime | getMonotonicTime () const |
ISystemClock & | getSystemClock () |
UtcTime | getUtcTime () const |
Scheduler (ICanDriver &can_driver, IPoolAllocator &allocator, ISystemClock &sysclock) | |
void | setCleanupPeriod (MonotonicDuration period) |
void | setDeadlineResolution (MonotonicDuration res) |
int | spin (MonotonicTime deadline) |
int | spinOnce () |
Private Types | |
enum | { DefaultDeadlineResolutionMs = 5 } |
enum | { MinDeadlineResolutionMs = 1 } |
enum | { MaxDeadlineResolutionMs = 100 } |
enum | { DefaultCleanupPeriodMs = 1000 } |
enum | { MinCleanupPeriodMs = 10 } |
enum | { MaxCleanupPeriodMs = 10000 } |
Private Member Functions | |
MonotonicTime | computeDispatcherSpinDeadline (MonotonicTime spin_deadline) const |
void | pollCleanup (MonotonicTime mono_ts, uint32_t num_frames_processed_with_last_spin) |
![]() | |
Noncopyable () | |
~Noncopyable () | |
This class distributes processing time between library components (IO handling, deadline callbacks, ...).
Definition at line 63 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
DefaultDeadlineResolutionMs |
Definition at line 65 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
MinDeadlineResolutionMs |
Definition at line 66 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
MaxDeadlineResolutionMs |
Definition at line 67 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
DefaultCleanupPeriodMs |
Definition at line 69 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
MinCleanupPeriodMs |
Definition at line 70 of file scheduler.hpp.
|
private |
Enumerator | |
---|---|
MaxCleanupPeriodMs |
Definition at line 71 of file scheduler.hpp.
|
inline |
Definition at line 95 of file scheduler.hpp.
|
private |
Definition at line 129 of file uc_scheduler.cpp.
|
inline |
How often the scheduler will run cleanup (listeners, outgoing transfer registry, ...). Cleanup execution time grows linearly with number of listeners and number of items in the Outgoing Transfer ID registry. Lower period increases CPU usage.
Definition at line 144 of file scheduler.hpp.
|
inline |
Worst case deadline callback resolution. Higher resolution increases CPU usage.
Definition at line 130 of file scheduler.hpp.
|
inline |
Definition at line 117 of file scheduler.hpp.
|
inline |
Definition at line 119 of file scheduler.hpp.
|
inline |
Definition at line 120 of file scheduler.hpp.
|
inline |
Definition at line 123 of file scheduler.hpp.
|
inline |
Definition at line 122 of file scheduler.hpp.
|
inline |
Definition at line 124 of file scheduler.hpp.
|
private |
Definition at line 143 of file uc_scheduler.cpp.
|
inline |
Definition at line 145 of file scheduler.hpp.
|
inline |
Definition at line 131 of file scheduler.hpp.
int uavcan::Scheduler::spin | ( | MonotonicTime | deadline | ) |
Spin until the deadline, or until some error occurs. This function will return strictly when the deadline is reached, even if there are unprocessed frames. Returns negative error code.
Definition at line 155 of file uc_scheduler.cpp.
int uavcan::Scheduler::spinOnce | ( | ) |
Non-blocking version of spin() - spins until all pending frames and events are processed, or until some error occurs. If there's nothing to do, returns immediately. Returns negative error code.
Definition at line 186 of file uc_scheduler.cpp.
|
private |
Definition at line 77 of file scheduler.hpp.
|
private |
Definition at line 76 of file scheduler.hpp.
|
private |
Definition at line 73 of file scheduler.hpp.
|
private |
Definition at line 74 of file scheduler.hpp.
|
private |
Definition at line 78 of file scheduler.hpp.
|
private |
Definition at line 75 of file scheduler.hpp.