Skip to content

Add deprecation tip to PowerManagement.md #1171

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

Closed
wants to merge 1 commit into from

Conversation

AnotherButler
Copy link
Contributor

Add tip about replacing deprecated API.

Add tip about replacing deprecated API.
Copy link
Member

@bulislaw bulislaw left a comment

Choose a reason for hiding this comment

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

This is not accurate. The wait API was repleced by

MBED_DEPRECATED_SINCE("mbed-os-5.14",
"'wait' is deprecated in favor of explicit sleep functions. To sleep, 'wait' should be replaced by "
"'ThisThread::sleep_for' (C++) or 'thread_sleep_for' (C). If you wish to wait (without sleeping), call "
"'wait_us'. 'wait_us' is safe to call from ISR context.")

But it's a bit dispersed so adding a notice to each place would be probably too noisy.

@AnotherButler
Copy link
Contributor Author

@bulislaw Yes, I pulled the wording for this tip from that quote in the code. Are you saying we should keep the tip here and also add it to the ThisThread API page?

@bulislaw
Copy link
Member

I think this notice shouldn't be there. We don't want people in RTOS environment to call the system sleep right now. In most cases it won't change anything and it doesn't achieve the same result as sleep_for.

@kjbracey
Copy link
Contributor

kjbracey commented Nov 26, 2019

There is the existing line 13 note saying you shouldn't normally use (system) sleep directly, but use RTOS API functions that can lead to system sleep (which includes ThisThread::sleep_for). That still applies, and possibly should be made stronger.

I'd say the same tip could be added to just the ThisThread page, and not add anything here.

@AnotherButler
Copy link
Contributor Author

Closing in favor of #1180

@AnotherButler AnotherButler deleted the AnotherButler-patch-3 branch December 4, 2019 20:48
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.

3 participants