summaryrefslogtreecommitdiffstats
path: root/firmware/usbconfig.h
diff options
context:
space:
mode:
authorTim <cpldcpu@gmail.com>2015-07-26 20:28:13 +0200
committerTim <cpldcpu@gmail.com>2015-07-26 20:28:13 +0200
commit3e01026caa72cc1cf25bddf3158dea4f439dd169 (patch)
treeea384817b369de8dd66e1fc19b6c0b369415e006 /firmware/usbconfig.h
parentc2c3125d000b34b7b828e364b43216069aea5878 (diff)
parent4362370cd98492d761a3e19e84da007163378464 (diff)
downloadmicronucleus-3e01026caa72cc1cf25bddf3158dea4f439dd169.tar.gz
micronucleus-3e01026caa72cc1cf25bddf3158dea4f439dd169.tar.bz2
micronucleus-3e01026caa72cc1cf25bddf3158dea4f439dd169.zip
Merge pull request #66 from micronucleus/Testing-V2.1v2.0b
Pull request for V2.1
Diffstat (limited to 'firmware/usbconfig.h')
-rw-r--r--firmware/usbconfig.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/firmware/usbconfig.h b/firmware/usbconfig.h
index 65864df..7ca31c5 100644
--- a/firmware/usbconfig.h
+++ b/firmware/usbconfig.h
@@ -184,7 +184,18 @@ return;\
/* define this macro to 1 if you want the function usbMeasureFrameLength()
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
*/
-#define USB_USE_FAST_CRC 0
+
+
+#if USB_CFG_CLOCK_KHZ<16000
+ #define USB_USE_FAST_CRC 1
+#else
+ #define USB_USE_FAST_CRC 0
+#endif
+
+/* If the CPU clock is below 16Mhz you have to use the faster CRC routines.
+ * otherwise time outs may occur on USB3.0 ports. This adds 20 bytes.
+ */
+
/* The assembler module has two implementations for the CRC algorithm. One is
* faster, the other is smaller. This CRC routine is only used for transmitted
* messages where timing is not critical. The faster routine needs 31 cycles