aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Starkjohann <cs+github@obdev.at>2017-01-24 23:33:12 +0100
committerChristian Starkjohann <cs+github@obdev.at>2017-01-24 23:33:12 +0100
commit672c6fdb930ca73ff37ab13ca8ca66700467980d (patch)
tree37fd33f198d7330c490c813c149b004690a7f610
parent4658fc9b4759bf70abd0c4eba1c4c6faa6f9b0ff (diff)
downloadv-usb-672c6fdb930ca73ff37ab13ca8ca66700467980d.tar.gz
v-usb-672c6fdb930ca73ff37ab13ca8ca66700467980d.tar.bz2
v-usb-672c6fdb930ca73ff37ab13ca8ca66700467980d.zip
Made `usbMsgFlags` public.
Users can set it to `USB_FLG_MSGPTR_IS_ROM` and set `usbMsgPtr` to a flash memory address.
-rw-r--r--usbdrv/usbdrv.c3
-rw-r--r--usbdrv/usbdrv.h9
2 files changed, 10 insertions, 2 deletions
diff --git a/usbdrv/usbdrv.c b/usbdrv/usbdrv.c
index c5bb664..44c9c3f 100644
--- a/usbdrv/usbdrv.c
+++ b/usbdrv/usbdrv.c
@@ -45,9 +45,8 @@ uchar usbCurrentDataToken;/* when we check data toggling to ignore duplica
/* USB status registers / not shared with asm code */
usbMsgPtr_t usbMsgPtr; /* data to transmit next -- ROM or RAM address */
static usbMsgLen_t usbMsgLen = USB_NO_MSG; /* remaining number of bytes */
-static uchar usbMsgFlags; /* flag values see below */
+uchar usbMsgFlags; /* flag values see USB_FLG_* */
-#define USB_FLG_MSGPTR_IS_ROM (1<<6)
#define USB_FLG_USE_USER_RW (1<<7)
/*
diff --git a/usbdrv/usbdrv.h b/usbdrv/usbdrv.h
index 113854e..f094120 100644
--- a/usbdrv/usbdrv.h
+++ b/usbdrv/usbdrv.h
@@ -208,6 +208,15 @@ extern usbMsgPtr_t usbMsgPtr;
* implementation of usbFunctionWrite(). It is also used internally by the
* driver for standard control requests.
*/
+
+extern uchar usbMsgFlags; /* flag values see USB_FLG_* */
+/* Can be set to `USB_FLG_MSGPTR_IS_ROM` in `usbFunctionSetup()` or
+ * `usbFunctionDescriptor()` if `usbMsgPtr` has been set to a flash memory
+ * address.
+ */
+
+#define USB_FLG_MSGPTR_IS_ROM (1<<6)
+
USB_PUBLIC usbMsgLen_t usbFunctionSetup(uchar data[8]);
/* This function is called when the driver receives a SETUP transaction from
* the host which is not answered by the driver itself (in practice: class and