ME507 Utility Library
0.2.1
Mechatronics Course Support Software for ARM/Arduino/FreeRTOS
|
Go to the documentation of this file.
135 queue = xQueueCreate (1,
sizeof (DataType));
142 void put (DataType new_data)
144 xQueueOverwrite (
queue, &new_data);
156 xQueueOverwriteFromISR (
queue, &new_data, &wake_up);
170 if (CHECK_IF_IN_ISR ())
173 xQueueOverwriteFromISR (
queue, &new_data, &wake_up);
177 xQueueOverwrite (
queue, &new_data);
197 if (CHECK_IF_IN_ISR ())
200 xQueuePeekFromISR (
queue, &put_here);
204 xQueuePeek (
queue, &put_here, portMAX_DELAY);
217 void get (DataType& recv_data)
220 xQueuePeek (
queue, &recv_data, portMAX_DELAY);
232 DataType return_this;
235 xQueuePeek (
queue, &return_this, portMAX_DELAY);
249 xQueuePeekFromISR (
queue, &recv_data);
262 DataType return_this;
263 xQueuePeekFromISR (
queue, &return_this);
281 template <
class DataType>
285 printer.printf (
"%-16sshare\t", name);
293 p_next->print_in_list (printer);
297 #endif // _TASKSHARE_H_
void print_in_list(Print &printer)
Print the name and type (share) of this data item.
Definition: taskshare.h:282
void ISR_put(DataType new_data)
Put data into the shared data item from within an ISR.
Definition: taskshare.h:153
void operator<<(DataType new_data)
Operator which inserts data into the share.
Definition: taskshare.h:168
void operator>>(DataType put_here)
Read data from the shared data item.
Definition: taskshare.h:195
void get(DataType &recv_data)
Read data from the shared data item into a variable.
Definition: taskshare.h:217
Class for data to be shared in a thread-safe manner between tasks.
Definition: taskshare.h:119
QueueHandle_t queue
A queue is used to hold the data, as it's portable to different CPU's.
Definition: taskshare.h:123
Headers for a base class for type-safe, thread-safe task data exchange classes.
void ISR_get(DataType &recv_data)
Read data from the shared data item, from within an ISR.
Definition: taskshare.h:247
DataType get(void)
Read and return data from the shared data item.
Definition: taskshare.h:230
void put(DataType new_data)
Put data into the shared data item.
Definition: taskshare.h:142
Base class for classes that share data in a thread-safe manner between tasks.
Definition: baseshare.h:54
DataType ISR_get(void)
Read and return data from the shared data item, from within an ISR.
Definition: taskshare.h:260