Files | |
file | mars_task_signal.h |
[host] MARS Task Signal API | |
file | mars_task_signal.h |
[MPU] MARS Task Signal API | |
Functions | |
int | mars_task_signal_send (struct mars_task_id *id) |
[host] Sends a signal to the specified task. | |
int | mars_task_signal_wait (void) |
[MPU] Waits and yields caller task until receiving signal. (Blocking) | |
int | mars_task_signal_try_wait (void) |
[MPU] Waits for task until receiving signal. (Non-Blocking) |
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] 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 task'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 to signal |
int mars_task_signal_wait | ( | void | ) |
[MPU] Waits and yields caller task until receiving signal. (Blocking)
This function will cause the task to enter a waiting state until some other entity calls mars_task_signal_send to this task to return it to the ready state. The task will not be scheduled to run until it receives the signal and returned to the ready state.
int mars_task_signal_try_wait | ( | void | ) |
[MPU] Waits for task until receiving signal. (Non-Blocking)
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.