summaryrefslogtreecommitdiffstats
path: root/firmware/osccalASM.S
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2015-01-12 00:46:06 +0100
committercpldcpu <cpldcpu@gmail.com>2015-01-12 00:46:06 +0100
commit42f2d8cc38064c67a9478826f563f5110c3848ee (patch)
tree2add26052b2d424d9efaa5848b654b16f0e3d4cf /firmware/osccalASM.S
parent80419704f68bf0783c5de63a6a4b9d89b45235c7 (diff)
downloadmicronucleus-42f2d8cc38064c67a9478826f563f5110c3848ee.tar.gz
micronucleus-42f2d8cc38064c67a9478826f563f5110c3848ee.tar.bz2
micronucleus-42f2d8cc38064c67a9478826f563f5110c3848ee.zip
#ENABLE_UNSAFE_OPTIMIZATIONS
Added new global flag to enable unsafe optimizations: This will disable several safety features in microncleus to save around 40 more bytes Disabled features: * Stack pointer and SREG initialization in CRT * Client side reset vector patching * USB collision detection. Micronucleus will not work reliability with hubs if this is disabled. See t85_aggressive configuration for usage examples.
Diffstat (limited to 'firmware/osccalASM.S')
-rw-r--r--firmware/osccalASM.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/osccalASM.S b/firmware/osccalASM.S
index fa26dc4..57730bf 100644
--- a/firmware/osccalASM.S
+++ b/firmware/osccalASM.S
@@ -147,6 +147,9 @@ usbCOWaitLoop:
sbic USBIN, USBMINUS ;[2]
rjmp usbCOWaitLoop ;[3]
+ ; This section of code deals with traffic from other USB devices on the same hub.
+ ; If this code is excluded, micronucleus may only work when it is connected to a dedicated USB port
+#ifndef ENABLE_UNSAFE_OPTIMIZATIONS
sbis USBIN, USBPLUS ; ignore frame if data is present
rjmp usbCOnotdata
@@ -161,7 +164,8 @@ usbCOWaitNoData2:
sbis USBIN, USBMINUS ; wait for D- go to high
rjmp usbCOWaitNoData2
rjmp usbCOLoopNoCal
-
+#endif
+
usbCOnotdata:
sbrs cnt16H, 7 ;delay overflow?
rjmp usbCOclocktoolow