Skip to content

Commit 466011a

Browse files
authored
feat(hid-rp): Regenerate hid usage pages (#387)
1 parent eebd90d commit 466011a

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

components/hid-rp/include/hid-rp-switch-pro.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class SwitchProGamepadInputReport : public hid::report::base<hid::report::type::
174174
// TODO: for report id 0x31, there are aditional 313 bytes of NFC/IR data input
175175
// after this.
176176
} __attribute__((packed)); // data union
177-
} __attribute__((packed)); // input report data struct
177+
} __attribute__((packed)); // input report data struct
178178
// this will ensure we always have enough space for the largest report
179179
// without having padding bytes defined anywhere.
180180
uint8_t raw_report[63];
@@ -203,15 +203,11 @@ class SwitchProGamepadInputReport : public hid::report::base<hid::report::type::
203203
constexpr void set_counter(uint8_t value) { counter = value; }
204204

205205
/// Increment the counter
206-
constexpr void increment_counter() {
207-
counter = (counter + 1);
208-
}
206+
constexpr void increment_counter() { counter = (counter + 1); }
209207

210208
/// Get the counter value
211209
/// @return The counter value
212-
constexpr uint8_t get_counter() const {
213-
return counter;
214-
}
210+
constexpr uint8_t get_counter() const { return counter; }
215211

216212
/// Set the subcommand ACK
217213
/// @param ack The subcommand ACK to set

components/hid-rp/include/hid/page/button.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace hid::page {
77
class button;
88
template <> struct info<button> {
99
constexpr static page_id_t page_id = 0x0009;
10-
constexpr static usage_id_t max_usage_id = 0x00ff;
10+
constexpr static usage_id_t max_usage_id = 0xffff;
1111
constexpr static const char *name = "Button";
1212
};
1313
class button {
1414
public:
1515
constexpr operator usage_id_t() const { return id; }
16-
explicit constexpr button(std::uint8_t value)
16+
explicit constexpr button(std::uint16_t value)
1717
: id(value) {}
18-
std::uint8_t id{};
18+
std::uint16_t id{};
1919
};
2020
} // namespace hid::page
2121

components/hid-rp/include/hid/page/generic_desktop.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ enum class generic_desktop : std::uint8_t {
9595
SYSTEM_SPEAKER_MUTE = 0x00a7,
9696
SYSTEM_HIBERNATE = 0x00a8,
9797
SYSTEM_MICROPHONE_MUTE = 0x00a9,
98+
SYSTEM_ACCESSIBILITY_BINDING = 0x00aa,
9899
SYSTEM_DISPLAY_INVERT = 0x00b0,
99100
SYSTEM_DISPLAY_INTERNAL = 0x00b1,
100101
SYSTEM_DISPLAY_EXTERNAL = 0x00b2,

components/hid-rp/include/hid/page/monitor_enumerated.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace hid::page {
77
class monitor_enumerated;
88
template <> struct info<monitor_enumerated> {
99
constexpr static page_id_t page_id = 0x0081;
10-
constexpr static usage_id_t max_usage_id = 0x00ff;
10+
constexpr static usage_id_t max_usage_id = 0xffff;
1111
constexpr static const char *name = "Monitor Enumerated";
1212
};
1313
class monitor_enumerated {
1414
public:
1515
constexpr operator usage_id_t() const { return id; }
16-
constexpr monitor_enumerated(std::uint8_t value)
16+
explicit constexpr monitor_enumerated(std::uint16_t value)
1717
: id(value) {}
18-
std::uint8_t id{};
18+
std::uint16_t id{};
1919
};
2020
} // namespace hid::page
2121

components/hid-rp/include/hid/page/ordinal.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace hid::page {
77
class ordinal;
88
template <> struct info<ordinal> {
99
constexpr static page_id_t page_id = 0x000a;
10-
constexpr static usage_id_t max_usage_id = 0x00ff;
10+
constexpr static usage_id_t max_usage_id = 0xffff;
1111
constexpr static const char *name = "Ordinal";
1212
};
1313
class ordinal {
1414
public:
1515
constexpr operator usage_id_t() const { return id; }
16-
constexpr ordinal(std::uint8_t value)
16+
explicit constexpr ordinal(std::uint16_t value)
1717
: id(value) {}
18-
std::uint8_t id{};
18+
std::uint16_t id{};
1919
};
2020
} // namespace hid::page
2121

components/hid-rp/include/hid/page/unicode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ template <> struct info<unicode> {
1313
class unicode {
1414
public:
1515
constexpr operator usage_id_t() const { return id; }
16-
constexpr unicode(std::uint8_t value)
16+
explicit constexpr unicode(std::uint8_t value)
1717
: id(value) {}
1818
std::uint8_t id{};
1919
};

0 commit comments

Comments
 (0)