-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for different reading modes #34
Conversation
This is a way to do it without adding any additional definitions.
|
@mizuyoukanao thanks for sharing. I am not sure if this is the way to go, as it would rearrange the data in the current report. Meaning you cannot simply send it twice. I would prefer to have the additional union types to define different modes. We could then write converter functions like your code above that converts modes. This can be used if you are reading the controller in a different mode than the console requests it. On the other side we do not know which mode the console might request, so your idea might be still a valid solution. Maybe we should use an additional array to cache the data, so all modifications will be only taken on this temporary array, not the real data? Not sure if it has a performance impact as well. Uuuf really unsure about that on.e |
Great work! I've added some comments to your PR. |
@mizuyoukanao Do you think it would make sense to add the reading mode request to the read function as well? It could be an optional parameter which defaults to 0x03? Lines 63 to 66 in 596da5f
Not sure if it consumes more memory/flash then... |
Closing in favor of: #42 |
Replaces #25 and #31
The idea or this PR is to arrange the sending data in the Gamecube_Report_t itself and accept all reading modes (0-7) by default. The data structure represents reading mode 3, the other modes must be implemented on your own. It is possible, that most of the time the sending will work with 0x00 data if you do not care about the changed triggers.