libDaisy
Hardware Library for Daisy
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LoggerHelperMacros

Detailed Description

Macros

#define LOGGER_NEWLINE   "\r\n"
 
#define LOGGER_BUFFER   128
 
#define PPCAT_NX(A, B)
 
#define PPCAT(A, B)
 
#define STRINGIZE_NX(A)
 
#define STRINGIZE(A)
 
#define FLT_FMT(_n)
 
#define FLT_VAR(_n, _x)
 
#define FLT_FMT3   FLT_FMT(3)
 
#define FLT_VAR3(_x)
 

Macro Definition Documentation

◆ FLT_FMT

#define FLT_FMT ( _n)
Value:
STRINGIZE(PPCAT(PPCAT(%c%d.%0, _n), d))
#define PPCAT(A, B)
Definition logger.h:35
#define STRINGIZE(A)
Definition logger.h:37

Floating point output formatting string. Include in your printf-style format string example: printf("float value = " FLT_FMT(3) " continue like that", FLT_VAR(3, x));

◆ FLT_FMT3

#define FLT_FMT3   FLT_FMT(3)

Shorthand for 10^-3 fraction, output equivalent to %.3f

◆ FLT_VAR

#define FLT_VAR ( _n,
_x )
Value:
(_x < 0 ? '-' : ' '), (int)(abs(_x)), \
(int)(((abs(_x)) - (int)(abs(_x))) * pow(10, (_n)))

Floating point output variable preprocessing Note: uses truncation instead of rounding -> the last digit may be off

◆ FLT_VAR3

#define FLT_VAR3 ( _x)
Value:
FLT_VAR(3, _x)
#define FLT_VAR(_n, _x)
Definition logger.h:49

Shorthand for 10^-3 fraction

◆ LOGGER_BUFFER

#define LOGGER_BUFFER   128

size in bytes

◆ LOGGER_NEWLINE

#define LOGGER_NEWLINE   "\r\n"

Logger configuration custom newline character sequence

◆ PPCAT

#define PPCAT ( A,
B )
Value:
PPCAT_NX(A, B)
#define PPCAT_NX(A, B)
Definition logger.h:34

concatenate tokens

◆ PPCAT_NX

#define PPCAT_NX ( A,
B )
Value:
A##B

Helper macros for string concatenation and macro expansion non-expanding concatenation

◆ STRINGIZE

#define STRINGIZE ( A)
Value:
#define STRINGIZE_NX(A)
Definition logger.h:36

make a string

◆ STRINGIZE_NX

#define STRINGIZE_NX ( A)
Value:
#A

non-expanding stringize