Skip to content

Commit

Permalink
Set default DEVICE_DMESG_BUFFER_SIZE based on DMESG_ENABLE. (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-carlos authored Apr 20, 2023
1 parent 350a794 commit ac74d3d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions inc/core/CodalConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,28 @@ DEALINGS IN THE SOFTWARE.
//
// Debug options
//
#ifndef DEVICE_DMESG
#define DEVICE_DMESG 0
#ifndef DMESG_SERIAL_DEBUG
#define DMESG_SERIAL_DEBUG 0
#else
// Automatically enable DMESG_ENABLE if DMESG_SERIAL_DEBUG is set
#if DMESG_SERIAL_DEBUG > 0
#define DMESG_ENABLE 1
#endif
#endif

#ifndef DMESG_ENABLE
#define DMESG_ENABLE 0
#endif

// When non-zero internal debug messages (DMESG() macro) go to a in-memory buffer of this size (in bytes).
// It can be inspected from GDB (with 'print codalLogStore'), or accessed by the application.
// Typical size range between 512 and 4096. Set to 0 to disable.
#ifndef DEVICE_DMESG_BUFFER_SIZE
#define DEVICE_DMESG_BUFFER_SIZE 1024
#if DMESG_ENABLE > 0
#define DEVICE_DMESG_BUFFER_SIZE 1024
#else
#define DEVICE_DMESG_BUFFER_SIZE 0
#endif
#endif

#ifndef CODAL_DEBUG
Expand Down

0 comments on commit ac74d3d

Please sign in to comment.