20
20
#include "platform/mbed_critical.h"
21
21
#include "sleep_api.h"
22
22
#include "platform/mbed_error.h"
23
- #include "platform/mbed_debug.h"
24
23
#include "platform/mbed_stats.h"
25
24
#include "us_ticker_api.h"
26
25
#include "lp_ticker_api.h"
27
26
#include <limits.h>
28
27
#include <stdio.h>
29
28
#include "platform/mbed_stats.h"
30
-
29
+ #include "platform/mbed_interface.h"
31
30
32
31
#if DEVICE_SLEEP
33
32
@@ -105,14 +104,14 @@ static sleep_statistic_t *sleep_tracker_add(const char *const filename)
105
104
}
106
105
}
107
106
108
- debug ("No free indexes left to use in mbed sleep tracker.\r\n" );
107
+ mbed_error_printf ("No free indexes left to use in mbed sleep tracker.\r\n" );
109
108
110
109
return NULL ;
111
110
}
112
111
113
112
static void sleep_tracker_print_stats (void )
114
113
{
115
- debug ("Sleep locks held:\r\n" );
114
+ mbed_error_printf ("Sleep locks held:\r\n" );
116
115
for (int i = 0 ; i < STATISTIC_COUNT ; ++ i ) {
117
116
if (sleep_stats [i ].count == 0 ) {
118
117
continue ;
@@ -122,8 +121,8 @@ static void sleep_tracker_print_stats(void)
122
121
return ;
123
122
}
124
123
125
- debug ("[id: %s, count: %u]\r\n" , sleep_stats [i ].identifier ,
126
- sleep_stats [i ].count );
124
+ mbed_error_printf ("[id: %s, count: %u]\r\n" , sleep_stats [i ].identifier ,
125
+ sleep_stats [i ].count );
127
126
}
128
127
}
129
128
@@ -138,7 +137,7 @@ void sleep_tracker_lock(const char *const filename, int line)
138
137
139
138
core_util_atomic_incr_u8 (& stat -> count , 1 );
140
139
141
- debug ("LOCK: %s, ln: %i, lock count: %u\r\n" , filename , line , deep_sleep_lock );
140
+ mbed_error_printf ("LOCK: %s, ln: %i, lock count: %u\r\n" , filename , line , deep_sleep_lock );
142
141
}
143
142
144
143
void sleep_tracker_unlock (const char * const filename , int line )
@@ -147,13 +146,13 @@ void sleep_tracker_unlock(const char *const filename, int line)
147
146
148
147
// Entry for this driver does not exist, something went wrong.
149
148
if (stat == NULL ) {
150
- debug ("Unlocking sleep for driver that was not previously locked: %s, ln: %i\r\n" , filename , line );
149
+ mbed_error_printf ("Unlocking sleep for driver that was not previously locked: %s, ln: %i\r\n" , filename , line );
151
150
return ;
152
151
}
153
152
154
153
core_util_atomic_decr_u8 (& stat -> count , 1 );
155
154
156
- debug ("UNLOCK: %s, ln: %i, lock count: %u\r\n" , filename , line , deep_sleep_lock );
155
+ mbed_error_printf ("UNLOCK: %s, ln: %i, lock count: %u\r\n" , filename , line , deep_sleep_lock );
157
156
}
158
157
159
158
#endif // MBED_SLEEP_TRACING_ENABLED
0 commit comments