aboutsummaryrefslogtreecommitdiffstats
path: root/usbdrv
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2008-10-18 15:41:24 +0000
committerChristian Starkjohann <cs+github@obdev.at>2008-10-18 15:41:24 +0000
commit81d3988ca8af8a763a9fddda0efa1b6f3ddfb251 (patch)
treeea8d738d4cc55f6d28940fee557dcadbb70456ac /usbdrv
parentd93f7a22edcb9084ef0e3323cd527d1fbe3cd80d (diff)
downloadv-usb-81d3988ca8af8a763a9fddda0efa1b6f3ddfb251.tar.gz
v-usb-81d3988ca8af8a763a9fddda0efa1b6f3ddfb251.tar.bz2
v-usb-81d3988ca8af8a763a9fddda0efa1b6f3ddfb251.zip
- added hook for SOF code
Diffstat (limited to 'usbdrv')
-rw-r--r--usbdrv/usbconfig-prototype.h18
-rw-r--r--usbdrv/usbdrvasm12.inc3
-rw-r--r--usbdrv/usbdrvasm128.inc3
-rw-r--r--usbdrv/usbdrvasm15.inc3
-rw-r--r--usbdrv/usbdrvasm16.inc3
-rw-r--r--usbdrv/usbdrvasm165.inc3
-rw-r--r--usbdrv/usbdrvasm20.inc3
7 files changed, 36 insertions, 0 deletions
diff --git a/usbdrv/usbconfig-prototype.h b/usbdrv/usbconfig-prototype.h
index 5883461..03598c1 100644
--- a/usbdrv/usbconfig-prototype.h
+++ b/usbdrv/usbconfig-prototype.h
@@ -156,6 +156,24 @@ section at the end of this file).
* counts SOF packets. This feature requires that the hardware interrupt is
* connected to D- instead of D+.
*/
+/* #ifdef __ASSEMBLER__
+ * macro myAssemblerMacro
+ * in YL, TCNT0
+ * sts timer0Snapshot, YL
+ * endm
+ * #endif
+ * #define USB_SOF_HOOK myAssemblerMacro
+ * This macro (if defined) is executed in the assembler module when a
+ * Start Of Frame condition is detected. It is recommended to define it to
+ * the name of an assembler macro which is defined here as well so that more
+ * than one assembler instruction can be used. The macro may use registers
+ * YL and YH and SREG.
+ * What can you do with this hook? Since the SOF signal occurs exactly every
+ * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
+ * designs running on the internal RC oscillator.
+ * Please note that Start Of Frame detection works only if D- is wired to the
+ * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
+ */
#define USB_CFG_CHECK_DATA_TOGGLING 0
/* define this macro to 1 if you want to filter out duplicate data packets
* sent by the host. Duplicates occur only as a consequence of communication
diff --git a/usbdrv/usbdrvasm12.inc b/usbdrv/usbdrvasm12.inc
index 389dbb7..d9da1dc 100644
--- a/usbdrv/usbdrvasm12.inc
+++ b/usbdrv/usbdrvasm12.inc
@@ -69,6 +69,9 @@ waitForK:
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
foundK:
;{3, 5} after falling D- edge, average delay: 4 cycles [we want 4 for center sampling]
diff --git a/usbdrv/usbdrvasm128.inc b/usbdrv/usbdrvasm128.inc
index f300865..effed45 100644
--- a/usbdrv/usbdrvasm128.inc
+++ b/usbdrv/usbdrvasm128.inc
@@ -128,6 +128,9 @@ waitForK:
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
foundK:
diff --git a/usbdrv/usbdrvasm15.inc b/usbdrv/usbdrvasm15.inc
index d9dd427..689d2a3 100644
--- a/usbdrv/usbdrvasm15.inc
+++ b/usbdrv/usbdrvasm15.inc
@@ -70,6 +70,9 @@ waitForK: ;-
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
;------------------------------------------------------------------------------
; {3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for
diff --git a/usbdrv/usbdrvasm16.inc b/usbdrv/usbdrvasm16.inc
index 3d1ce5d..44b00fa 100644
--- a/usbdrv/usbdrvasm16.inc
+++ b/usbdrv/usbdrvasm16.inc
@@ -64,6 +64,9 @@ waitForK:
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
foundK: ;[-12]
;{3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for center sampling]
diff --git a/usbdrv/usbdrvasm165.inc b/usbdrv/usbdrvasm165.inc
index 6a9ef7e..b37ac96 100644
--- a/usbdrv/usbdrvasm165.inc
+++ b/usbdrv/usbdrvasm165.inc
@@ -69,6 +69,9 @@ waitForK:
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
foundK: ;[-12]
;{3, 5} after falling D- edge, average delay: 4 cycles [we want 5 for center sampling]
diff --git a/usbdrv/usbdrvasm20.inc b/usbdrv/usbdrvasm20.inc
index a8dee1c..2d4be52 100644
--- a/usbdrv/usbdrvasm20.inc
+++ b/usbdrv/usbdrvasm20.inc
@@ -86,6 +86,9 @@ waitForK:
inc YL
sts usbSofCount, YL
#endif /* USB_COUNT_SOF */
+#ifdef USB_SOF_HOOK
+ USB_SOF_HOOK
+#endif
rjmp sofError
foundK: ;[-16]
;{3, 5} after falling D- edge, average delay: 4 cycles