mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpilibc] SPI & I2C: Use handle wrapper to close port (#7217)
This commit is contained in:
@@ -19,16 +19,4 @@ HAL_ENUM(HAL_I2CPort) {
|
||||
HAL_I2C_kOnboard,
|
||||
HAL_I2C_kMXP
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace hal {
|
||||
|
||||
/**
|
||||
* A move-only C++ wrapper around HAL_I2CPort.
|
||||
* Does not ensure destruction.
|
||||
*/
|
||||
using I2CPort = Handle<HAL_I2CPort, nullptr, HAL_I2C_kInvalid>;
|
||||
|
||||
} // namespace hal
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
@@ -41,16 +41,4 @@ HAL_ENUM(HAL_SPIMode) {
|
||||
/** Clock idle high, data sampled on rising edge. */
|
||||
HAL_SPI_kMode3 = 3,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace hal {
|
||||
|
||||
/**
|
||||
* A move-only C++ wrapper around HAL_SPIPort.
|
||||
* Does not ensure destruction.
|
||||
*/
|
||||
using SPIPort = Handle<HAL_SPIPort, nullptr, HAL_SPI_kInvalid>;
|
||||
|
||||
} // namespace hal
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
Reference in New Issue
Block a user