-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
[WIP] boards name and number external SPI consistently #11336
Conversation
cbfeefa
to
b582f08
Compare
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.
Do we need to state that bus and CS numbering are 1 based?
See Questions
@@ -244,17 +243,17 @@ __BEGIN_DECLS | |||
#define PX4_SENSOR_BUS_FIRST_CS PX4_SPIDEV_ACCEL_MAG | |||
#define PX4_SENSOR_BUS_LAST_CS PX4_SPIDEV_GYRO | |||
|
|||
#define PX4_SPIDEV_EXTERNAL1 PX4_MK_SPI_SEL(PX4_SPI_BUS_EXTERNAL,0) | |||
#define PX4_SPIDEV_EXTERNAL2 PX4_MK_SPI_SEL(PX4_SPI_BUS_EXTERNAL,1) | |||
#define PX4_SPIDEV_EXTERNAL1_1 PX4_MK_SPI_SEL(PX4_SPI_BUS_EXTERNAL1,0) |
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.
formatting
#ifdef PX4_SPI_BUS_EXT | ||
#define px4_spi_bus_external(bus) (bus == PX4_SPI_BUS_EXT) | ||
#ifdef PX4_SPI_BUS_EXTERNAL1 | ||
#define px4_spi_bus_external(bus) (bus == PX4_SPI_BUS_EXTERNAL1) |
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.
Should this be a complex with all the externals?
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.
Yes
|
||
if (g_dev == nullptr) { | ||
goto fail; | ||
} | ||
|
||
if (OK != g_dev->init()) { | ||
|
||
#ifdef PX4_SPIDEV_EXTERNAL1_2 |
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.
Is this the same functionality as it was?
b582f08
to
fa54cbc
Compare
@davids5 what's up with this? |
@julianoes - it was @dagar work and has rotted. If if cleans it up and resolve the open, we can review it again. I would make the CS as external in the ID - i.e PX4_MK_SPI_EXT_SEL - then they are self describing. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
This PR unifies the mess of different external SPI bus naming and numbering across boards.
Master
PR
Gradually working towards a simple unified mechanism for handling optional external peripherals without pushing the burden into every single driver and board.