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

forward declare board_millis for OPT_OS_CUSTOM #2549

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

duckylotl
Copy link
Contributor

When porting examples to a custom OS the missing forward declaration of board_millis creates problems.
The forward declaration lets custom OS ports use the board_api.h for use of board_usb_get_serial and implement board_millis anywhere if needed with the correct signature.

The CDC examples include the bsp/board_api.h in usb_descriptors.c for use of board_usb_get_serial. board_api.h also includes implementation of board_delay which uses board_millis. But in case of OPT_OS_CUSTOM it has not been declared anywhere, so it gets implicitly declared as int board_millis(void) which will not link with an implementation using the correct unsigned int return type.

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.

Look good, thank you.

note: ci failed due to my incorrect labeler workflow and can be safe to ignore

@hathach hathach merged commit a5a9093 into hathach:master Mar 28, 2024
49 of 50 checks passed
@duckylotl duckylotl deleted the patch-1 branch March 28, 2024 15:47
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