Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

HidenoriKobayashi
Copy link
Contributor

This adds support for a U-blox GPS device on SPI bus. This needs another PR for the Firmware.

@@ -108,10 +108,12 @@ GPSDriverUBX::configure(unsigned &baudrate, OutputMode output_mode)
{
_configured = false;
_output_mode = output_mode;
#if !defined(__PX4_POSIX_RPI)
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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)
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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?

@bkueng
Copy link
Member

bkueng commented Sep 28, 2016

cleaned up & applied

@bkueng bkueng closed this Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants