Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Delay appending the HID descriptors until .begin() #62

Merged
merged 1 commit into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/MultiReport/ConsumerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ static const uint8_t _hidMultiReportDescriptorConsumer[] PROGMEM = {
};

ConsumerControl_::ConsumerControl_(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorConsumer, sizeof(_hidMultiReportDescriptorConsumer));
HID().AppendDescriptor(&node);
}

void ConsumerControl_::begin(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorConsumer, sizeof(_hidMultiReportDescriptorConsumer));
HID().AppendDescriptor(&node);

// release all buttons
end();
}
Expand Down
5 changes: 3 additions & 2 deletions src/MultiReport/Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ static const uint8_t _hidMultiReportDescriptorKeyboard[] PROGMEM = {
};

Keyboard_::Keyboard_(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorKeyboard, sizeof(_hidMultiReportDescriptorKeyboard));
HID().AppendDescriptor(&node);
}

void Keyboard_::begin(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorKeyboard, sizeof(_hidMultiReportDescriptorKeyboard));
HID().AppendDescriptor(&node);

// Force API to send a clean report.
// This is important for and HID bridge where the receiver stays on,
// while the sender is resetted.
Expand Down
5 changes: 3 additions & 2 deletions src/MultiReport/SystemControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ static const uint8_t _hidMultiReportDescriptorSystem[] PROGMEM = {
};

SystemControl_::SystemControl_(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorSystem, sizeof(_hidMultiReportDescriptorSystem));
HID().AppendDescriptor(&node);
}

void SystemControl_::begin(void) {
static HIDSubDescriptor node(_hidMultiReportDescriptorSystem, sizeof(_hidMultiReportDescriptorSystem));
HID().AppendDescriptor(&node);

// release all buttons
end();
}
Expand Down