-
Notifications
You must be signed in to change notification settings - Fork 198
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
Navio: Add support for SPI-connected GPS #5
Conversation
@@ -108,10 +108,12 @@ GPSDriverUBX::configure(unsigned &baudrate, OutputMode output_mode) | |||
{ | |||
_configured = false; | |||
_output_mode = output_mode; | |||
#if !defined(__PX4_POSIX_RPI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good if you could change this to an interface flag instead configure(enum interface, unsigned baud, output mode)
. Then the interface setting controls wether or not the baud rate is applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better if we add the interface information to the GPSDriverUBX constructor since the interface information is static?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, yes. That's better than my original proposal.
@@ -413,6 +436,18 @@ GPSDriverUBX::receive(unsigned timeout) | |||
handled |= parseChar(buf[i]); | |||
//UBX_DEBUG("parsed %d: 0x%x", i, buf[i]); | |||
} | |||
|
|||
#if defined(__PX4_POSIX_RPI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this RPI specific? Isn't this rather SPI interface specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should use if (_interface == GPSHelper::Interface::SPI)
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mayanez Have you seen this bit of feedback?
cleaned up & applied |
This adds support for a U-blox GPS device on SPI bus. This needs another PR for the Firmware.