From 044d47585ce3459ecbf7ce2bb87ea35992d0cdae Mon Sep 17 00:00:00 2001 From: Shay Green Date: Mon, 14 Jul 2014 17:04:12 -0500 Subject: firmware: osccalASM.S fixed to tolerate USB traffic, e.g. when on hub --- firmware/osccalASM.S | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'firmware') diff --git a/firmware/osccalASM.S b/firmware/osccalASM.S index e8e174e..6484350 100644 --- a/firmware/osccalASM.S +++ b/firmware/osccalASM.S @@ -113,6 +113,8 @@ usbCOloop: #endif nop +usbCOLoopNoCal: + ; Delay values = F_CPU * 999e-6 / 5 + 0.5 #if (F_CPU == 16500000) @@ -145,6 +147,22 @@ usbCOWaitLoop: sbic USBIN, USBMINUS ;[2] rjmp usbCOWaitLoop ;[3] + sbis USBIN, USBPLUS ; ignore frame if data is present + rjmp usbCOnotdata + +usbCOWaitNoData: + in cnt16H, USBIN ; wait for SE0 state (both lines low) + andi cnt16H, (1< Date: Mon, 14 Jul 2014 17:12:55 -0500 Subject: Expanded tabs for previous commit --- firmware/osccalASM.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'firmware') diff --git a/firmware/osccalASM.S b/firmware/osccalASM.S index 6484350..fa26dc4 100644 --- a/firmware/osccalASM.S +++ b/firmware/osccalASM.S @@ -147,20 +147,20 @@ usbCOWaitLoop: sbic USBIN, USBMINUS ;[2] rjmp usbCOWaitLoop ;[3] - sbis USBIN, USBPLUS ; ignore frame if data is present - rjmp usbCOnotdata + sbis USBIN, USBPLUS ; ignore frame if data is present + rjmp usbCOnotdata usbCOWaitNoData: - in cnt16H, USBIN ; wait for SE0 state (both lines low) - andi cnt16H, (1<