Skip to content

Commit bd23625

Browse files
author
Steven Cartmell
committed
Rename SLEEP_STATS_ENABLED to SLEEP_TRACING_ENABLED
1 parent 5a4027b commit bd23625

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

hal/mbed_sleep_manager.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
<<<<<<< HEAD
1718
#include "mbed_assert.h"
1819
#include "mbed_power_mgmt.h"
20+
=======
21+
#include "mbed_sleep.h"
22+
>>>>>>> Rename SLEEP_STATS_ENABLED to SLEEP_TRACING_ENABLED
1923
#include "mbed_critical.h"
2024
#include "sleep_api.h"
2125
#include "mbed_error.h"
@@ -27,7 +31,7 @@
2731
// deep sleep locking counter. A target is allowed to deep sleep if counter == 0
2832
static uint16_t deep_sleep_lock = 0U;
2933

30-
#ifdef MBED_SLEEP_STATS_ENABLED
34+
#ifdef MBED_SLEEP_TRACING_ENABLED
3135

3236
// Length of the identifier extracted from the driver name to store for logging.
3337
#define IDENTIFIER_WIDTH 7
@@ -85,7 +89,7 @@ static size_t sleep_tracker_find_index(const char *const filename)
8589
}
8690

8791
// Panic if there are no free indexes left to track with
88-
MBED_ASSERT(true);
92+
error("No free indexes left to use in mbed stats tracker");
8993

9094
return -1;
9195
}
@@ -127,7 +131,7 @@ void sleep_tracker_unlock(const char* const filename, int line)
127131
sleep_tracker_print_stats();
128132
}
129133

130-
#endif // MBED_SLEEP_STATS_ENABLED
134+
#endif // MBED_SLEEP_TRACING_ENABLED
131135

132136
void sleep_manager_lock_deep_sleep_internal(void)
133137
{

platform/mbed_sleep.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ extern "C" {
5959
* }
6060
* @endcode
6161
*/
62-
#ifdef MBED_SLEEP_STATS_ENABLED
62+
#ifdef MBED_SLEEP_TRACING_ENABLED
63+
64+
void sleep_tracker_lock(const char *const filename, int line);
65+
void sleep_tracker_unlock(const char *const filename, int line);
6366

6467
#define sleep_manager_lock_deep_sleep() \
6568
do \
@@ -75,9 +78,6 @@ extern "C" {
7578
sleep_tracker_unlock(__FILE__, __LINE__); \
7679
} while (0);
7780

78-
void sleep_tracker_lock(const char *const filename, int line);
79-
void sleep_tracker_unlock(const char *const filename, int line);
80-
8181
#else
8282

8383
#define sleep_manager_lock_deep_sleep() \
@@ -86,7 +86,7 @@ void sleep_tracker_unlock(const char *const filename, int line);
8686
#define sleep_manager_unlock_deep_sleep() \
8787
sleep_manager_lock_deep_sleep_internal()
8888

89-
#endif // MBED_SLEEP_STATS_ENABLED
89+
#endif // MBED_SLEEP_TRACING_ENABLED
9090

9191
/** Lock the deep sleep mode
9292
*

0 commit comments

Comments
 (0)