Add function to detect the gyro model in a 3ds#949
Open
rosaage wants to merge 5 commits intod0k3:masterfrom
Open
Add function to detect the gyro model in a 3ds#949rosaage wants to merge 5 commits intod0k3:masterfrom
rosaage wants to merge 5 commits intod0k3:masterfrom
Conversation
Contributor
|
Make sure to add the constant to the lua doc. |
Author
|
I also added it to the original gm9 scripting now along with some documentation in the lua-doc file. I was a bit unsure about the return value, but I ended up with a number instead of a string as I don't know the name of the 3rd model and I feel it's better for the API to not change if/when the model name is figured out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a function to get the gyro model as well as adding a string to sysinfo and a global int to the lua module.
The power registers and inspiration for the entire function comes from rehid:
https://github.com/hax0kartik/rehid/blob/5bfed26a1306be678fe3d6290c794e3bc529a086/source/Gyroscope.cpp#L97
Power registers were cross checked with problemkaputt.de for Gyro 0 and Gyro 1 along with adding who_am_i registers:
https://problemkaputt.de/gbatek-3ds-i2c-gyroscope-old-version.htm
https://problemkaputt.de/gbatek-3ds-i2c-gyroscope-new-version.htm
Simple lua test script:
ui.echo("Your Gyro model is: "..GYROMODEL)The code has been tested on: