| ... | @@ -11,7 +11,7 @@ The interface for adding a new task is pretty simple: |
... | @@ -11,7 +11,7 @@ The interface for adding a new task is pretty simple: |
|
|
size_t addTask(function_t function, uint32_t period, Policy policy = Policy::SKIP, int64_t startTick = miosix::getTick());
|
|
size_t addTask(function_t function, uint32_t period, Policy policy = Policy::SKIP, int64_t startTick = miosix::getTick());
|
|
|
```
|
|
```
|
|
|
Where `function_t` is an `std::function<void()>`.
|
|
Where `function_t` is an `std::function<void()>`.
|
|
|
The parameters are: the function to be periodically executed, the task period in milliseconds, an identifier for the task and the start time (by default set to the current system time).
|
|
The parameters are: the function to be periodically executed, the task period in milliseconds, the policy and the start time (by default set to the current system time). Note that the unique task ID is auto generated.
|
|
|
|
|
|
|
|
> :warning: **Tasks in the tasks scheduler are meant to be added at inizialization. This means that all the tasks have to be added to the scheduler before the _start()_ method is called (which will start the thread execution).**
|
|
> :warning: **Tasks in the tasks scheduler are meant to be added at inizialization. This means that all the tasks have to be added to the scheduler before the _start()_ method is called (which will start the thread execution).**
|
|
|
|
|
|
| ... | | ... | |