Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use before declaration of symbol in audio_device.c #1653

Closed
1 task done
battlesnake opened this issue Sep 21, 2022 · 2 comments
Closed
1 task done

Use before declaration of symbol in audio_device.c #1653

battlesnake opened this issue Sep 21, 2022 · 2 comments
Labels

Comments

@battlesnake
Copy link
Contributor

Operating System

Others

Board

Custom (STM32H7)

Firmware

  • st/synopsys port
  • no RTOS
  • gcc

I don't think any of these are relevant though, it's a compile-time error.

I propose a fix in PR #1646

What happened ?

Compiler error, due to a symbol being used before it is declared:

lib/tinyusb/src/class/audio/audio_device.c:2051:13: error: conflicting types for 'set_fb_params_freq'; have '_Bool(audiod_function_t *, uint32_t,  uint32_t)' {aka '_Bool(audiod_function_t *, long unsigned int,  long unsigned int)'}
 2051 | static bool set_fb_params_freq(audiod_function_t* audio, uint32_t sample_freq, uint32_t mclk_freq)
      |             ^~~~~~~~~~~~~~~~~~
lib/tinyusb/src/class/audio/audio_device.c:1718:13: note: previous implicit declaration of 'set_fb_params_freq' with type 'int()'
 1718 |             set_fb_params_freq(audio, fb_param.sample_freq, fb_param.frequency.mclk_freq);
      |             ^~~~~~~~~~~~~~~~~~

I propose a fix in PR #1646

How to reproduce ?

Try to compile an audio device with feedback enabled.

Specifically, with:

  • CFG_TUD_AUDIO_ENABLE_EP_OUT
  • CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP

I propose a fix in PR #1646 which I've tested in my setup.

I have two more fixes for other unrelated issues specific to STM32 relating to:

  • unaligned memory access, and
  • SOF handling

I'll create PRs and issues for those too once this issue is resolved.

Debug Log as txt file

Relevant compiler output:

lib/tinyusb/src/class/audio/audio_device.c:2051:13: error: conflicting types for 'set_fb_params_freq'; have '_Bool(audiod_function_t *, uint32_t,  uint32_t)' {aka '_Bool(audiod_function_t *, long unsigned int,  long unsigned int)'}
 2051 | static bool set_fb_params_freq(audiod_function_t* audio, uint32_t sample_freq, uint32_t mclk_freq)
      |             ^~~~~~~~~~~~~~~~~~
lib/tinyusb/src/class/audio/audio_device.c:1718:13: note: previous implicit declaration of 'set_fb_params_freq' with type 'int()'
 1718 |             set_fb_params_freq(audio, fb_param.sample_freq, fb_param.frequency.mclk_freq);
      |             ^~~~~~~~~~~~~~~~~~

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
@battlesnake
Copy link
Contributor Author

PR: #1646

@hathach
Copy link
Owner

hathach commented Oct 14, 2022

closed by #1646

@hathach hathach closed this as completed Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants