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 }}
Repository navigation
Callback use of user_data is inconsistent or unavailable across SDK #71
The use of user_data in callbacks is of importance because it can allow callback to a class method when using C++/OOP via a non capturing Lambda function, which is great.
There is an inconsistency with how the user_data is implemented or if it is implemented in some cases.
The two different schemes are the alarm scheme where user_data is passed as a second argument to the callback:
The use of user_data in callbacks is of importance because it can allow callback to a class method when using C++/OOP via a non capturing Lambda function, which is great.
There is an inconsistency with how the user_data is implemented or if it is implemented in some cases.
The two different schemes are the alarm scheme where user_data is passed as a second argument to the callback:
Having a consistent scheme between the two would be great, with the alarm scheme being more idiomatic from what I can tell.
The reason for the repeating timer owning the callback here, is that the repeating timer can be wholly user owned state (it seemed superfluous to allocate another object on top of the alarm). It then seemed equally superfluous to extract the user data out of the structure and marshall it as an argument
Also of concern is the lack of user_data on the following callbacks and types.
With the lack on IRQs my primary concern as it makes for example a Sensor class for a hall effect sensor difficult.
We certainly don't associate any state with IRQ handlers themselves, however that can and should be handled/provided by any abstraction which provides multiplexed routing based on the underlying IRQ, for sure.
Activity
kilograham commentedon Apr 8, 2021
The reason for the repeating timer owning the callback here, is that the repeating timer can be wholly user owned state (it seemed superfluous to allocate another object on top of the alarm). It then seemed equally superfluous to extract the user data out of the structure and marshall it as an argument
yes, the hold gpio irq API should not have made it in in its current form; it needs to be replaced.
We certainly don't associate any state with IRQ handlers themselves, however that can and should be handled/provided by any abstraction which provides multiplexed routing based on the underlying IRQ, for sure.
Fix raspberrypi#71: Add user_data to gpio IRQ.