mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Switches SPI and I2C to use enums in the HAL for ports (#531)
Closes #397
This commit is contained in:
committed by
Peter Johnson
parent
67d62ba164
commit
b2f3479692
@@ -19,10 +19,9 @@ using namespace frc;
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param SPIport the physical SPI port
|
||||
* @param port the physical SPI port
|
||||
*/
|
||||
SPI::SPI(Port SPIport) {
|
||||
m_port = SPIport;
|
||||
SPI::SPI(Port port) : m_port(static_cast<HAL_SPIPort>(port)) {
|
||||
int32_t status = 0;
|
||||
HAL_InitializeSPI(m_port, &status);
|
||||
wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
|
||||
|
||||
Reference in New Issue
Block a user