Skip to content

Commit 1c9a839

Browse files
committed
audio_device: Fix unused variable warning
In some configurations local variable p_desc_parse_for_params is declared and never used resulting in warning that can be escalated to build error (for mynewt) Now variable is surrounded with same preprocessor condition as function that uses it audiod_parse_for_AS_params()
1 parent 57bbf3a commit 1c9a839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/class/audio/audio_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
17291729
// Find correct interface
17301730
if (tu_desc_type(p_desc) == TUSB_DESC_INTERFACE && ((tusb_desc_interface_t const * )p_desc)->bInterfaceNumber == itf && ((tusb_desc_interface_t const * )p_desc)->bAlternateSetting == alt)
17311731
{
1732-
#if CFG_TUD_AUDIO_ENABLE_ENCODING || CFG_TUD_AUDIO_ENABLE_DECODING || CFG_TUD_AUDIO_EP_IN_FLOW_CONTROL
1732+
#if (CFG_TUD_AUDIO_ENABLE_EP_IN && (CFG_TUD_AUDIO_EP_IN_FLOW_CONTROL || CFG_TUD_AUDIO_ENABLE_ENCODING)) || (CFG_TUD_AUDIO_ENABLE_EP_OUT && CFG_TUD_AUDIO_ENABLE_DECODING)
17331733
uint8_t const * p_desc_parse_for_params = p_desc;
17341734
#endif
17351735
// From this point forward follow the EP descriptors associated to the current alternate setting interface - Open EPs if necessary

0 commit comments

Comments
 (0)