Skip to content

Commit d3933de

Browse files
authored
feat(GPIO): Add comparison operators to Pin struct (#548)
1 parent caa702f commit d3933de

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Inc/HALAL/Models/GPIO.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ struct GPIODomain {
159159
return true;
160160
return ((1 << static_cast<uint8_t>(af)) & afs) != 0;
161161
}
162+
163+
constexpr bool operator==(const Pin &other) const {
164+
return (port == other.port) && (pin == other.pin);
165+
}
166+
167+
constexpr bool operator!=(const Pin &other) const {
168+
return !(*this == other);
169+
}
162170
};
163171

164172
struct Entry {

0 commit comments

Comments
 (0)