mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibc] Fix GetUsbId on ExpansionHub in C++ (#8704)
This commit is contained in:
@@ -69,6 +69,10 @@ bool ExpansionHub::IsHubConnected() const {
|
||||
return m_dataStore->m_hubConnectedSubscriber.Get(false);
|
||||
}
|
||||
|
||||
int ExpansionHub::GetUsbId() const {
|
||||
return m_dataStore->m_usbId;
|
||||
}
|
||||
|
||||
bool ExpansionHub::CheckAndReserveServo(int channel) {
|
||||
int mask = 1 << channel;
|
||||
std::scoped_lock lock{m_dataStore->m_reservedLock};
|
||||
|
||||
@@ -62,7 +62,7 @@ class ExpansionHub {
|
||||
*
|
||||
* @return The USB ID
|
||||
*/
|
||||
int GetUsbId() const { return m_usbId; }
|
||||
int GetUsbId() const;
|
||||
|
||||
static constexpr int NumUsbPorts = 4;
|
||||
static constexpr int NumServoPorts = 6;
|
||||
@@ -81,7 +81,6 @@ class ExpansionHub {
|
||||
friend class DataStore;
|
||||
|
||||
std::shared_ptr<DataStore> m_dataStore;
|
||||
int m_usbId;
|
||||
|
||||
static wpi::util::mutex m_handleLock;
|
||||
static std::weak_ptr<DataStore> m_storeMap[4];
|
||||
|
||||
Reference in New Issue
Block a user