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

HAL callback functions in the core should should be declared as weak so they can be overridden in the sketch #7

Closed
fpistm opened this issue Jun 2, 2017 · 6 comments

Comments

@fpistm
Copy link
Member

fpistm commented Jun 2, 2017

From @rogerclarkmelbourne on November 23, 2016 21:2

HAL callback functions in the core should should be declared as weak so they can be overridden in the sketch

Copied from original issue: fpistm/Arduino_Core_STM32L4#8

@fpistm
Copy link
Member Author

fpistm commented Jun 2, 2017

From @fprwi6labs on January 10, 2017 12:22

Can you declare the same function weak more than one time?
In the doubt I tried and I can say that it is not possible because gcc returns an error (multiple definition).

@fpistm
Copy link
Member Author

fpistm commented Jun 2, 2017

From @rogerclarkmelbourne on January 10, 2017 21:39

OK.
Perhaps there need to be some code changes so they are only declared once as weak.

I'm sure someone else posted about this to the forum, I'll need to find the post and link it here.

@fpistm
Copy link
Member Author

fpistm commented Jun 2, 2017

From @fprwi6labs on January 16, 2017 16:15

I'm really curious to know how the linker manages the case where the same function is declared twice as weak. Maybe there is a way but I don't know it...

@Adminius
Copy link
Contributor

Does it mean, that i can implement interrupt driven uart receive function?

@fpistm
Copy link
Member Author

fpistm commented Oct 20, 2017

@Adminius you could have a look at the SerialEvent function which is weak.
It is not an interrupt CB but it allows to handle received data.

Note: this will be functional in the next core release.

@fpistm
Copy link
Member Author

fpistm commented Oct 20, 2017

Close this issue as no update and already several weak function.
New issue could be opened if specific one are requested.

@fpistm fpistm closed this as completed Oct 20, 2017
fpistm pushed a commit that referenced this issue Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants