Skip to content

Commit 900749e

Browse files
committed
fix compile linkage issue with debug.cpp
1 parent fcf1833 commit 900749e

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

cores/nRF5/debug.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extern uint32_t __StackLimit[];
5656
extern "C"
5757
{
5858

59-
int cprintf(const char * format, ...)
59+
int cprintf (char const * format, ...)
6060
{
6161
char buf[256];
6262
int len;
@@ -81,6 +81,8 @@ void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName )
8181
cprintf("%s Stack Overflow !!!", pcTaskName);
8282
}
8383

84+
}
85+
8486
int dbgHeapTotal(void)
8587
{
8688
return ((uint32_t) __HeapLimit) - ((uint32_t) __HeapBase);
@@ -114,7 +116,7 @@ int dbgStackUsed(void)
114116
return ((uint32_t) p_end) - ((uint32_t) p_buf);
115117
}
116118

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)
118120
{
119121
char buffer[30];
120122
if ( used )
@@ -181,7 +183,7 @@ static void dump_str_line(uint8_t const* buf, uint16_t count)
181183
// each line is 16 bytes
182184
for(int i=0; i<count; i++)
183185
{
184-
const char ch = buf[i];
186+
char const ch = buf[i];
185187
cprintf("%c", isprint(ch) ? ch : '.');
186188
}
187189
}
@@ -199,7 +201,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
199201
char format[] = "%00lX";
200202
format[2] += 2*size;
201203

202-
const uint8_t item_per_line = 16 / size;
204+
uint8_t const item_per_line = 16 / size;
203205

204206
for(int i=0; i<count; i++)
205207
{
@@ -233,7 +235,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
233235
}
234236

235237
// fill up last row to 16 for printing ascii
236-
const uint16_t remain = count%16;
238+
uint16_t const remain = count % 16;
237239
uint8_t nback = (remain ? remain : 16);
238240

239241
if ( remain )
@@ -253,7 +255,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
253255
}
254256

255257

256-
void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count)
258+
void dbgDumpMemoryCFormat (char const * str, void const *buf, uint16_t count)
257259
{
258260
if ( !buf )
259261
{
@@ -298,7 +300,7 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count)
298300
*------------------------------------------------------------------*/
299301

300302
// Common BLE Event base
301-
static const char* _evt_base_str[] =
303+
static char const * _evt_base_str[] =
302304
{
303305
#if SD_VER < 500
304306
"BLE_EVT_TX_COMPLETE" ,
@@ -307,7 +309,7 @@ static const char* _evt_base_str[] =
307309
"BLE_EVT_USER_MEM_RELEASE" ,
308310
};
309311

310-
static const char* _evt_gap_str[] =
312+
static char const * _evt_gap_str[] =
311313
{
312314
"BLE_GAP_EVT_CONNECTED" ,
313315
"BLE_GAP_EVT_DISCONNECTED" ,
@@ -333,7 +335,7 @@ static const char* _evt_gap_str[] =
333335
};
334336

335337
// GATTC Event
336-
static const char* _evt_gattc_str[] =
338+
static char const * _evt_gattc_str[] =
337339
{
338340
"BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP" ,
339341
"BLE_GATTC_EVT_REL_DISC_RSP" ,
@@ -355,7 +357,7 @@ static const char* _evt_gattc_str[] =
355357
};
356358

357359
// GATTS Event
358-
static const char* _evt_gatts_str[] =
360+
static char const * _evt_gatts_str[] =
359361
{
360362
"BLE_GATTS_EVT_WRITE" ,
361363
"BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST" ,
@@ -371,7 +373,7 @@ static const char* _evt_gatts_str[] =
371373
#endif
372374
};
373375

374-
const char* dbg_ble_event_str(uint16_t evt_id)
376+
char const * dbg_ble_event_str (uint16_t evt_id)
375377
{
376378
static char unknown_evt[7] = {0};
377379

@@ -463,9 +465,9 @@ lookup_table_t const _err_table =
463465
.items = _err_lookup_items
464466
};
465467

466-
const char* dbg_err_str(uint32_t err_id)
468+
char const * dbg_err_str (uint32_t err_id)
467469
{
468-
const char * str = (const char *) lookup_find(&_err_table, err_id);
470+
char const * str = (char const *) lookup_find(&_err_table, err_id);
469471
static char unknown_err[7] = {0};
470472

471473
if ( str == NULL )
@@ -479,5 +481,3 @@ const char* dbg_err_str(uint32_t err_id)
479481

480482
#endif
481483

482-
}
483-

0 commit comments

Comments
 (0)