mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11: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
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
HAL_ENUM(HAL_I2CPort) { HAL_I2C_kOnboard = 0, HAL_I2C_kMXP };
|
||||
HAL_ENUM(HAL_I2CPort) { HAL_I2C_kInvalid = -1, HAL_I2C_kOnboard, HAL_I2C_kMXP };
|
||||
// clang-format on
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
// clang-format off
|
||||
HAL_ENUM(HAL_SPIPort) {
|
||||
HAL_SPI_kOnboardCS0 = 0,
|
||||
HAL_SPI_kInvalid = -1,
|
||||
HAL_SPI_kOnboardCS0,
|
||||
HAL_SPI_kOnboardCS1,
|
||||
HAL_SPI_kOnboardCS2,
|
||||
HAL_SPI_kOnboardCS3,
|
||||
|
||||
Reference in New Issue
Block a user