mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
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:
committed by
Peter Johnson
parent
b505bbefd1
commit
467c9fd686
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user