Repository navigation
Add nav pins: per-device sensor pin settings - #5
Open
ShivtejG236 wants to merge 1 commit into
Open
ShivtejG236 wants to merge 1 commit into
ShivtejG236 wants to merge 1 commit into
Conversation
navkit can now send the firmware's SET_PINS and RESET_PINS commands and read its ACK. Each board is identified by the unique id in its HELLO; its pins are stored on the device and a copy is kept in <workspace>/devices/<id>.json so they can be restored after a flash erase. A pin choice is checked against the board's pin rules from the firmware release manifest before it is sent, and the reasons are shown. When the rules cannot be fetched the device's own check decides.
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.
Host side of firmware PR multi-sensor-navigation-system/firmware#7.
What
nav pins/nav pins show: the connected board's unique id and the GPIOs in use.nav pins set [--sda N] [--scl N] [--gps-rx N] [--gps-tx N]: store new pins on that board. Signals not given keep their pin.nav pins reset: back to the board defaults.nav pins restore: put the saved pins back after a flash erase.navkit.wire: frame encoder,SET_PINS/RESET_PINS,ACKdecoding.navkit.device: the conversation with the board (retry on a lost command, wait for theHELLOafter the restart) and the per-device profiles in<workspace>/devices/<id>.json.Checks on a pin choice
pin_rulesfrom the firmware release manifest and prints every reason.The device id comes from the board, so it is validated as 12 hex digits before it is used in a file name.
Compatibility
Works only with firmware that has pin settings; older firmware gets a message to update. Logging and the rest of the pipeline are unchanged.
Tests
35 new tests (108 total). Command frames are compared byte for byte with the firmware encoder's output. The conversation is tested against a stand-in for the board, not real hardware.