Skip to content

Commit dc0b679

Browse files
committed
print error string instead of hex code
1 parent 5607011 commit dc0b679

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

cores/nRF5/common_func.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
#endif
122122

123123
int cprintf(const char * format, ...);
124+
const char* dbg_err_str(uint32_t err_id); // TODO move to other place
124125

125126
#if CFG_DEBUG
126127
#define LOG_LV1(...) ADALOG(__VA_ARGS__)

cores/nRF5/debug.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
#include <stdint.h>
3838
#include <stdarg.h>
3939
#include <malloc.h>
40-
#include "debug.h"
41-
#include "utility/utilities.h"
40+
#include <Arduino.h>
4241

4342
// defined in linker script
4443
extern uint32_t __data_start__[];

cores/nRF5/debug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@
3737
#ifndef _DEBUG_H
3838
#define _DEBUG_H
3939

40-
#include <Arduino.h>
40+
#include "common_inc.h"
4141

4242
#if CFG_DEBUG
4343
const char* dbg_ble_event_str(uint16_t evt_id);
44+
const char* dbg_err_str(uint32_t err_id);
4445
#endif
4546

4647
int dbgHeapTotal(void);

cores/nRF5/verify.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extern "C"
6565
//--------------------------------------------------------------------+
6666
#if CFG_DEBUG >= 1
6767
// #define VERIFY_MESS(format, ...) cprintf("[%08ld] %s: %d: verify failed\n", get_millis(), __func__, __LINE__)
68-
#define VERIFY_MESS(_status) cprintf("%s: %d: verify failed, status = 0x%04X\n", __PRETTY_FUNCTION__, __LINE__, _status);
68+
#define VERIFY_MESS(_status) cprintf("%s: %d: verify failed, status = %s\n", __PRETTY_FUNCTION__, __LINE__, dbg_err_str(_status));
6969
#else
7070
#define VERIFY_MESS(_status)
7171
#endif

0 commit comments

Comments
 (0)