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
{{ message }}
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.
Describe the feature
Comes from #185 (see comment there).
Notification.h defines values used for synchronization, such as the NOTIFIED_FROM_ flags that indicate if an rx, tx, or task woke up a thread.
#defineNOTIFIED_FROM_TX_ISR0x80/**< Notification from a transmitter ISR */
#defineNOTIFIED_FROM_RX_ISR0x20/**< Notification from a receiver ISR */
#defineNOTIFIED_FROM_TASK0x40/**< Notification from another task */
The values of the macros are application-specific values that we chose. To make components reusable, we should avoid components using these to reduce risk of collision with an application that might not necessarily use these values for synchonization macros.
Currently, UartDriver and MPU6050 are dependent on the above macros, to indicate whether an rx or tx event occurred when waiting for a transmission to finish.
After discussion with @tygamvrelis , we decided that this dependency issue would be solved by:
Abstracting the synchronization for any component code away from the code using it (Common/app/freertos.cpp). This would mean callback functions like HAL_UART_RxCpltCallback would instead loop over the UartDriver objects, check the UART handle, and call some public method on UartDriver that releases a semaphore to indicate the transaction completed if the handle matches.
Using other means of synchronization; instead of task notifications, use semaphores which are private members of the component class
An alternative mentioned was to have UartDriver have the NOTIFIED_FROM_* numbers as private const member variables, which app configures. However, app still needs to configure these, and thus think about them. We will try the semaphore implementation first.
Reason for request
Make components reusable, and simplify top level application logic.
Timeline
Tentatively mid-march so that we can get this done with the other maintenance tasks.
The text was updated successfully, but these errors were encountered:
Describe the feature
Comes from #185 (see comment there).
Notification.h defines values used for synchronization, such as the
NOTIFIED_FROM_
flags that indicate if an rx, tx, or task woke up a thread.The values of the macros are application-specific values that we chose. To make components reusable, we should avoid components using these to reduce risk of collision with an application that might not necessarily use these values for synchonization macros.
Currently, UartDriver and MPU6050 are dependent on the above macros, to indicate whether an rx or tx event occurred when waiting for a transmission to finish.
After discussion with @tygamvrelis , we decided that this dependency issue would be solved by:
Common/app/freertos.cpp
). This would mean callback functions likeHAL_UART_RxCpltCallback
would instead loop over the UartDriver objects, check the UART handle, and call some public method on UartDriver that releases a semaphore to indicate the transaction completed if the handle matches.An alternative mentioned was to have
UartDriver
have theNOTIFIED_FROM_*
numbers as private const member variables, whichapp
configures. However,app
still needs to configure these, and thus think about them. We will try the semaphore implementation first.Reason for request
Make components reusable, and simplify top level application logic.
Timeline
Tentatively mid-march so that we can get this done with the other maintenance tasks.
The text was updated successfully, but these errors were encountered: