@@ -56,7 +56,7 @@ extern uint32_t __StackLimit[];
56
56
extern " C"
57
57
{
58
58
59
- int cprintf ( const char * format, ...)
59
+ int cprintf ( char const * format, ...)
60
60
{
61
61
char buf[256 ];
62
62
int len;
@@ -81,6 +81,8 @@ void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
81
81
cprintf (" %s Stack Overflow !!!" , pcTaskName);
82
82
}
83
83
84
+ }
85
+
84
86
int dbgHeapTotal (void )
85
87
{
86
88
return ((uint32_t ) __HeapLimit) - ((uint32_t ) __HeapBase);
@@ -114,7 +116,7 @@ int dbgStackUsed(void)
114
116
return ((uint32_t ) p_end) - ((uint32_t ) p_buf);
115
117
}
116
118
117
- static void printMemRegion ( const char * name, uint32_t top, uint32_t bottom, uint32_t used)
119
+ static void printMemRegion ( char const * name, uint32_t top, uint32_t bottom, uint32_t used)
118
120
{
119
121
char buffer[30 ];
120
122
if ( used )
@@ -181,7 +183,7 @@ static void dump_str_line(uint8_t const* buf, uint16_t count)
181
183
// each line is 16 bytes
182
184
for (int i=0 ; i<count; i++)
183
185
{
184
- const char ch = buf[i];
186
+ char const ch = buf[i];
185
187
cprintf (" %c" , isprint (ch) ? ch : ' .' );
186
188
}
187
189
}
@@ -199,7 +201,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
199
201
char format[] = " %00lX" ;
200
202
format[2 ] += 2 *size;
201
203
202
- const uint8_t item_per_line = 16 / size;
204
+ uint8_t const item_per_line = 16 / size;
203
205
204
206
for (int i=0 ; i<count; i++)
205
207
{
@@ -233,7 +235,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
233
235
}
234
236
235
237
// fill up last row to 16 for printing ascii
236
- const uint16_t remain = count% 16 ;
238
+ uint16_t const remain = count % 16 ;
237
239
uint8_t nback = (remain ? remain : 16 );
238
240
239
241
if ( remain )
@@ -253,7 +255,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
253
255
}
254
256
255
257
256
- void dbgDumpMemoryCFormat ( const char * str, void const *buf, uint16_t count)
258
+ void dbgDumpMemoryCFormat ( char const * str, void const *buf, uint16_t count)
257
259
{
258
260
if ( !buf )
259
261
{
@@ -298,7 +300,7 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count)
298
300
*------------------------------------------------------------------*/
299
301
300
302
// Common BLE Event base
301
- static const char * _evt_base_str[] =
303
+ static char const * _evt_base_str[] =
302
304
{
303
305
#if SD_VER < 500
304
306
" BLE_EVT_TX_COMPLETE" ,
@@ -307,7 +309,7 @@ static const char* _evt_base_str[] =
307
309
" BLE_EVT_USER_MEM_RELEASE" ,
308
310
};
309
311
310
- static const char * _evt_gap_str[] =
312
+ static char const * _evt_gap_str[] =
311
313
{
312
314
" BLE_GAP_EVT_CONNECTED" ,
313
315
" BLE_GAP_EVT_DISCONNECTED" ,
@@ -333,7 +335,7 @@ static const char* _evt_gap_str[] =
333
335
};
334
336
335
337
// GATTC Event
336
- static const char * _evt_gattc_str[] =
338
+ static char const * _evt_gattc_str[] =
337
339
{
338
340
" BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP" ,
339
341
" BLE_GATTC_EVT_REL_DISC_RSP" ,
@@ -355,7 +357,7 @@ static const char* _evt_gattc_str[] =
355
357
};
356
358
357
359
// GATTS Event
358
- static const char * _evt_gatts_str[] =
360
+ static char const * _evt_gatts_str[] =
359
361
{
360
362
" BLE_GATTS_EVT_WRITE" ,
361
363
" BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST" ,
@@ -371,7 +373,7 @@ static const char* _evt_gatts_str[] =
371
373
#endif
372
374
};
373
375
374
- const char * dbg_ble_event_str (uint16_t evt_id)
376
+ char const * dbg_ble_event_str (uint16_t evt_id)
375
377
{
376
378
static char unknown_evt[7 ] = {0 };
377
379
@@ -463,9 +465,9 @@ lookup_table_t const _err_table =
463
465
.items = _err_lookup_items
464
466
};
465
467
466
- const char * dbg_err_str (uint32_t err_id)
468
+ char const * dbg_err_str (uint32_t err_id)
467
469
{
468
- const char * str = (const char *) lookup_find (&_err_table, err_id);
470
+ char const * str = (char const *) lookup_find (&_err_table, err_id);
469
471
static char unknown_err[7 ] = {0 };
470
472
471
473
if ( str == NULL )
@@ -479,5 +481,3 @@ const char* dbg_err_str(uint32_t err_id)
479
481
480
482
#endif
481
483
482
- }
483
-
0 commit comments