Switches SPI and I2C to use enums in the HAL for ports (#531)

Closes #397
This commit is contained in:
Thad House
2017-05-09 12:12:46 -07:00
committed by Peter Johnson
parent 67d62ba164
commit b2f3479692
14 changed files with 198 additions and 183 deletions

View File

@@ -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));