summaryrefslogtreecommitdiff
path: root/src/class
diff options
context:
space:
mode:
authorAndrew Leech <[email protected]>2026-05-31 22:49:22 +1000
committerAndrew Leech <[email protected]>2026-05-31 22:55:37 +1000
commit20f59d0228fb7a2d2de46de6265d65f21b068778 (patch)
treeef6a74717be74b3e112295a08193904ee70cf5cb /src/class
parent2c27ec9c89f95057e30da5d08c01f01c941b8a58 (diff)
cdc_host: fix undeclared 'idx' when only LINE_CONTROL_ON_ENUM defined
idx is used in the ENUM_SET_LINE_CONTROL path guarded by CFG_TUH_CDC_LINE_CONTROL_ON_ENUM, but was declared only under CFG_TUH_CDC_LINE_CODING_ON_ENUM. Defining LINE_CONTROL_ON_ENUM without LINE_CODING_ON_ENUM therefore failed to compile with an undeclared identifier. Guard the declaration under either macro. Signed-off-by: Andrew Leech <[email protected]>
Diffstat (limited to 'src/class')
-rw-r--r--src/class/cdc/cdc_host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/class/cdc/cdc_host.c b/src/class/cdc/cdc_host.c
index 62c313b83..976e7bea9 100644
--- a/src/class/cdc/cdc_host.c
+++ b/src/class/cdc/cdc_host.c
@@ -839,7 +839,7 @@ static bool set_line_state_on_enum(cdch_interface_t *p_cdc, tuh_xfer_t *xfer) {
ENUM_SET_LINE_CONTROL,
ENUM_SET_LINE_COMPLETE,
};
- #ifdef CFG_TUH_CDC_LINE_CODING_ON_ENUM
+ #if defined(CFG_TUH_CDC_LINE_CODING_ON_ENUM) || defined(CFG_TUH_CDC_LINE_CONTROL_ON_ENUM)
const uint8_t idx = get_idx_by_ptr(p_cdc);
#endif
const uintptr_t state = xfer->user_data;