Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit 50d2f27

Browse files
committed
define AdiPort::get_mutex out of line
1 parent d1f7f2c commit 50d2f27

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

include/pros/devices/port.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,7 @@ class AdiPort {
243243
*
244244
* @return pros::RecursiveMutex&
245245
*/
246-
pros::RecursiveMutex& get_mutex() const {
247-
if (m_host_port.as_number() > 22 || m_index > 7) {
248-
// return a reference to the invalid port mutex
249-
return SmartPort::from_number(33).get_mutex();
250-
} else {
251-
return m_host_port.get_mutex();
252-
}
253-
}
246+
pros::RecursiveMutex& get_mutex() const;
254247

255248
private:
256249
// the integrated ADI ports on the brain are represented by the virtual port 22

src/devices/port.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,13 @@ pros::RecursiveMutex& SmartPort::get_mutex() const {
1010
return m_mutexes.back();
1111
}
1212
}
13+
14+
pros::RecursiveMutex& AdiPort::get_mutex() const {
15+
if (m_host_port.as_number() > 22 || m_index > 7) {
16+
// return a reference to the invalid port mutex
17+
return SmartPort::from_number(33).get_mutex();
18+
} else {
19+
return m_host_port.get_mutex();
20+
}
21+
}
1322
}; // namespace zest

0 commit comments

Comments
 (0)