Add kInvalid value to HAL_I2CPort and HAL_SPIPort (#1329)

This allows HAL_CloseI2C() and HAL_CloseSPI() to be noops, which makes
enabling move semantics in the I2C and SPI wpilibc classes easier and
cleaner.

Fixes #1328.
This commit is contained in:
Tyler Veness
2018-09-23 21:14:04 -07:00
committed by Peter Johnson
parent b505bbefd1
commit 467c9fd686
6 changed files with 23 additions and 23 deletions

View File

@@ -9,9 +9,9 @@
#include <stdint.h>
#include "frc/ErrorBase.h"
#include <hal/I2C.h>
enum HAL_I2CPort : int32_t;
#include "frc/ErrorBase.h"
namespace frc {
@@ -135,7 +135,7 @@ class I2C : public ErrorBase {
bool VerifySensor(int registerAddress, int count, const uint8_t* expected);
private:
HAL_I2CPort m_port;
HAL_I2CPort m_port = HAL_I2C_kInvalid;
int m_deviceAddress;
};