From 20f59d0228fb7a2d2de46de6265d65f21b068778 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Sun, 31 May 2026 22:49:22 +1000 Subject: 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 --- src/class/cdc/cdc_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.3.1