Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 00f7d82

Browse files
purdeaandreiwhitequark
authored andcommitted
SETUP_EP0_BUF: enforce deprecation
1 parent 748c256 commit 00f7d82

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

firmware/library/include/fx2usb.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,19 @@ void usb_init(bool disconnect);
6868
* For OUT control transfers, please use one or more `SETUP_EP0_OUT_BUF()`,
6969
* followed by a single `ACK_EP0()` call, but only after all data has been
7070
* processed from `EP0BUF`.
71+
*
72+
* If one desires to use the deprecated SETUP_EP0_BUF, then it can be
73+
* re-enabled with:
74+
* `CFLAGS=-DSETUP_EP0_BUF_is_deprecated_use_SETUP_EP0_IN_BUF_or_SETUP_EP0_OUT_BUF_instead=1`
7175
*/
7276
#define SETUP_EP0_BUF(length) \
7377
do { \
74-
SUDPTRCTL = _SDPAUTO; \
75-
EP0BCH = 0; \
76-
EP0BCL = length; \
77-
EP0CS = _HSNAK; \
78+
if (SETUP_EP0_BUF_is_deprecated_use_SETUP_EP0_IN_BUF_or_SETUP_EP0_OUT_BUF_instead) { \
79+
SUDPTRCTL = _SDPAUTO; \
80+
EP0BCH = 0; \
81+
EP0BCL = length; \
82+
EP0CS = _HSNAK; \
83+
} \
7884
} while(0)
7985

8086
/**

0 commit comments

Comments
 (0)