Files | |
file | task_signal.h |
[host] MARS Task Signal API | |
file | task_signal.h |
[MPU] MARS Task Signal API | |
Functions | |
int | mars_task_signal_send (struct mars_task_id *id) |
[host/MPU] Sends a signal to the specified task. | |
int | mars_task_signal_wait (void) |
[MPU] Waits and yields caller task until receiving signal. (Task Switch Call) | |
int | mars_task_signal_try_wait (void) |
[MPU] Waits for task until receiving signal. |
From either a host program or MARS task you can specify a certain task to signal. When the task waits for a signal to be received it will be transitioned to the waiting state until the signal is received.
int mars_task_signal_send | ( | struct mars_task_id * | id | ) |
[host/MPU] Sends a signal to the specified task.
This function sends a signal to the task specified. If the task had previously called mars_task_signal_wait and was in the waiting state, this function will cause that task to switch to a ready state and scheduled to run accordingly. If the task has not yet called mars_task_signal_wait, the tasks's signal buffer will be set and the same order of events will occur as previously explained once mars_task_signal_wait is called. The task signal buffer depth is 1. Therefore if the signal buffer is already set when a another signal is received, it has no effect.
[in] | id | - pointer to task id of task to signal |
int mars_task_signal_wait | ( | void | ) |
[MPU] Waits and yields caller task until receiving signal. (Task Switch Call)
int mars_task_signal_try_wait | ( | void | ) |
[MPU] Waits for task until receiving signal.
This function will check the state of a task to see if some other entity has called mars_task_signal_send to this task and returns immediately with the result. Once the task receives the signal and this function returns MARS_SUCCESS, the signal buffer is cleared.