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

@@ -20,7 +20,7 @@ using namespace frc;
* @param deviceAddress The address of the device on the I2C bus.
*/
I2C::I2C(Port port, int deviceAddress)
: m_port(port), m_deviceAddress(deviceAddress) {
: m_port(static_cast<HAL_I2CPort>(port)), m_deviceAddress(deviceAddress) {
int32_t status = 0;
HAL_InitializeI2C(m_port, &status);
// wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));