You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using freertos, and I have a task listening serial messages. When the rx buffer is empty, I want the task to be blocked, or "sleep", and a rx callback will return the task to running state after several bytes have arrived. Otherwise the listening task will constantly occupies CPU time, leaves no process opportunity for other tasks, unless the priority of the task is low enough.
The value of ptr_to_callback_object is stored in a member of HardwareSerial. This way, the callback function can directly get the handle to the task. And the code of callback function can be reused in different projects without modification.
The text was updated successfully, but these errors were encountered:
I'm using freertos, and I have a task listening serial messages. When the rx buffer is empty, I want the task to be blocked, or "sleep", and a rx callback will return the task to running state after several bytes have arrived. Otherwise the listening task will constantly occupies CPU time, leaves no process opportunity for other tasks, unless the priority of the task is low enough.
The callback function would be like:
It would be more convenient to define the rx_callback function as:
The value of
ptr_to_callback_object
is stored in a member of HardwareSerial. This way, the callback function can directly get the handle to the task. And the code of callback function can be reused in different projects without modification.The text was updated successfully, but these errors were encountered: