From ae961877282007a28721a68e8041025c3c8de127 Mon Sep 17 00:00:00 2001 From: Lauszus Date: Thu, 15 Jul 2021 10:24:38 +0000 Subject: [PATCH] deploy: 395fca4aac5634dad19fb41c700fd6c2872ec013 --- hidboot_8h_source.html | 88 ++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/hidboot_8h_source.html b/hidboot_8h_source.html index 2e0959df..c34579e5 100644 --- a/hidboot_8h_source.html +++ b/hidboot_8h_source.html @@ -650,49 +650,53 @@ $(function() {
582 
583  // To-do: optimize manually, using the for loop only if needed.
584  for(int i = 0; i < epMUL(BOOT_PROTOCOL); i++) {
-
585  const uint16_t const_buff_len = 16;
-
586  uint8_t buf[const_buff_len];
-
587 
-
588  USBTRACE3("(hidboot.h) i=", i, 0x81);
-
589  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].epAddr=", epInfo[epInterruptInIndex + i].epAddr, 0x81);
-
590  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].maxPktSize=", epInfo[epInterruptInIndex + i].maxPktSize, 0x81);
-
591  uint16_t read = (uint16_t)epInfo[epInterruptInIndex + i].maxPktSize;
-
592 
-
593  rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex + i].epAddr, &read, buf);
-
594  // SOME buggy dongles report extra keys (like sleep) using a 2 byte packet on the wrong endpoint.
-
595  // Since keyboard and mice must report at least 3 bytes, we ignore the extra data.
-
596  if(!rcode && read > 2) {
-
597  if(pRptParser[i])
-
598  pRptParser[i]->Parse((USBHID*)this, 0, (uint8_t)read, buf);
-
599 #ifdef DEBUG_USB_HOST
-
600  // We really don't care about errors and anomalies unless we are debugging.
-
601  } else {
-
602  if(rcode != hrNAK) {
-
603  USBTRACE3("(hidboot.h) Poll:", rcode, 0x81);
-
604  }
-
605  if(!rcode && read) {
-
606  USBTRACE3("(hidboot.h) Strange read count: ", read, 0x80);
-
607  USBTRACE3("(hidboot.h) Interface:", i, 0x80);
+
585  const uint16_t const_buff_len = 64;
+
586 
+
587  USBTRACE3("(hidboot.h) i=", i, 0x81);
+
588  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].epAddr=", epInfo[epInterruptInIndex + i].epAddr, 0x81);
+
589  USBTRACE3("(hidboot.h) epInfo[epInterruptInIndex + i].maxPktSize=", epInfo[epInterruptInIndex + i].maxPktSize, 0x81);
+
590  uint16_t read = (uint16_t)epInfo[epInterruptInIndex + i].maxPktSize;
+
591 
+
592  if (read > const_buff_len)
+
593  read = const_buff_len;
+
594 
+
595  uint8_t buf[read];
+
596 
+
597  rcode = pUsb->inTransfer(bAddress, epInfo[epInterruptInIndex + i].epAddr, &read, buf);
+
598  // SOME buggy dongles report extra keys (like sleep) using a 2 byte packet on the wrong endpoint.
+
599  // Since keyboard and mice must report at least 3 bytes, we ignore the extra data.
+
600  if(!rcode && read > 2) {
+
601  if(pRptParser[i])
+
602  pRptParser[i]->Parse((USBHID*)this, 0, (uint8_t)read, buf);
+
603 #ifdef DEBUG_USB_HOST
+
604  // We really don't care about errors and anomalies unless we are debugging.
+
605  } else {
+
606  if(rcode != hrNAK) {
+
607  USBTRACE3("(hidboot.h) Poll:", rcode, 0x81);
608  }
-
609  }
-
610 
-
611  if(!rcode && read && (UsbDEBUGlvl > 0x7f)) {
-
612  for(uint8_t i = 0; i < read; i++) {
-
613  PrintHex<uint8_t > (buf[i], 0x80);
-
614  USBTRACE1(" ", 0x80);
-
615  }
-
616  if(read)
-
617  USBTRACE1("\r\n", 0x80);
-
618 #endif
-
619  }
-
620 
-
621  }
-
622  qNextPollTime = (uint32_t)millis() + bInterval;
-
623  }
-
624  return rcode;
-
625 }
-
626 
-
627 #endif // __HIDBOOTMOUSE_H__
+
609  if(!rcode && read) {
+
610  USBTRACE3("(hidboot.h) Strange read count: ", read, 0x80);
+
611  USBTRACE3("(hidboot.h) Interface:", i, 0x80);
+
612  }
+
613  }
+
614 
+
615  if(!rcode && read && (UsbDEBUGlvl > 0x7f)) {
+
616  for(uint8_t i = 0; i < read; i++) {
+
617  PrintHex<uint8_t > (buf[i], 0x80);
+
618  USBTRACE1(" ", 0x80);
+
619  }
+
620  if(read)
+
621  USBTRACE1("\r\n", 0x80);
+
622 #endif
+
623  }
+
624 
+
625  }
+
626  qNextPollTime = (uint32_t)millis() + bInterval;
+
627  }
+
628  return rcode;
+
629 }
+
630 
+
631 #endif // __HIDBOOTMOUSE_H__
Definition: hidboot.h:39
#define hrNAK
Definition: max3421e.h:218