File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,11 @@ class DigiJoystickDevice {
161
161
162
162
// instead of above code, use millis arduino system to enforce minimum reporting frequency
163
163
unsigned long time_since_last_report = millis () - last_report_time;
164
- if (time_since_last_report >= (idle_rate * 4 /* in units of 4ms - usb spec stuff */ )) {
164
+ /* idle_rate == 0, never send idle reports
165
+ cf https://www.usb.org/sites/default/files/hid1_11.pdf 7.2.4 "Set_Idle Request":
166
+ "When the upper byte of wValue is 0 (zero), the duration is indefinite. The endpoint will
167
+ inhibit reporting forever, only reporting when a change is detected in the report data." */
168
+ if (idle_rate > 0 && time_since_last_report >= (idle_rate * 4 /* in units of 4ms - usb spec stuff */ )) {
165
169
last_report_time += idle_rate * 4 ;
166
170
must_report = 1 ;
167
171
}
Original file line number Diff line number Diff line change @@ -185,7 +185,11 @@ class DigiMouseDevice {
185
185
186
186
// instead of above code, use millis arduino system to enforce minimum reporting frequency
187
187
unsigned long time_since_last_report = millis () - last_report_time;
188
- if (time_since_last_report >= (idle_rate * 4 /* in units of 4ms - usb spec stuff */ )) {
188
+ /* idle_rate == 0, never send idle reports
189
+ cf https://www.usb.org/sites/default/files/hid1_11.pdf 7.2.4 "Set_Idle Request":
190
+ "When the upper byte of wValue is 0 (zero), the duration is indefinite. The endpoint will
191
+ inhibit reporting forever, only reporting when a change is detected in the report data." */
192
+ if (idle_rate > 0 && time_since_last_report >= (idle_rate * 4 /* in units of 4ms - usb spec stuff */ )) {
189
193
last_report_time += idle_rate * 4 ;
190
194
must_report = 1 ;
191
195
}
You can’t perform that action at this time.
0 commit comments