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

audio_device: prototype added for function referenced before use #1646

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

battlesnake
Copy link
Contributor

Describe the PR
Fixes the following compiler error when compiling an audio device with feedback enabled (no rtos, st/synopsys port).

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);
      |             ^~~~~~~~~~~~~~~~~~

Ås the line-numbers there indicate, the first definition of the function is ~300 lines after the call site referencing it.

Additional context
I'm not sure what the best solution would be for the style of the library - to add a prototype at top-level, add one at the call-site, or move the function upwards.

I suspect one of the first two options from what I've seen so far, so I put this together quickly to get feedback on where exactly the prototype should be placed.

@battlesnake
Copy link
Contributor Author

Issue: #1653

@battlesnake
Copy link
Contributor Author

CI issue might be due to compiler bug,
internal compiler error: Illegal instruction

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the fix

@hathach
Copy link
Owner

hathach commented Oct 14, 2022

CI issue might be due to compiler bug, internal compiler error: Illegal instruction

sometime ci failed due to network/bandwidth issues.

@hathach hathach merged commit 154821a into hathach:master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants