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

Debug build flag + change to sleep behavior in debug mode #4097

Merged
merged 4 commits into from
Apr 18, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disable sleep and deepsleep when MBED_DEBUG macro is defined
  • Loading branch information
bulislaw committed Apr 10, 2017
commit 57dc2a540c05cd1e83b1639b20395d0a2c2e81e7
12 changes: 6 additions & 6 deletions platform/mbed_sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
/** Send the microcontroller to sleep
*
* @note This function can be a noop if not implemented by the platform.
* @note This function will only put device to sleep in release mode (small profile or when NDEBUG is defined).
* @note This function will be a noop in debug mode (debug build profile when MBED_DEBUG is defined)
*
* The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the
* system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
Expand All @@ -44,17 +44,17 @@ extern "C" {
*/
__INLINE static void sleep(void)
{
#ifdef NDEBUG
#ifndef MBED_DEBUG
#if DEVICE_SLEEP
hal_sleep();
#endif /* DEVICE_SLEEP */
#endif /* NDEBUG */
#endif /* MBED_DEBUG */
}

/** Send the microcontroller to deep sleep
*
* @note This function can be a noop if not implemented by the platform.
* @note This function will only put device to sleep in release mode (small profile or when NDEBUG is defined).
* @note This function will be a noop in debug mode (debug build profile when MBED_DEBUG is defined)
*
* This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
* has the same sleep features as sleep plus it powers down peripherals and clocks. All state
Expand All @@ -69,11 +69,11 @@ __INLINE static void sleep(void)
*/
__INLINE static void deepsleep(void)
{
#ifdef NDEBUG
#ifndef MBED_DEBUG
#if DEVICE_SLEEP
hal_deepsleep();
#endif /* DEVICE_SLEEP */
#endif /* NDEBUG */
#endif /* MBED_DEBUG */
}

#ifdef __cplusplus
Expand Down