2#ifndef __DSY_LOGGER_H__
3#define __DSY_LOGGER_H__
28#define LOGGER_NEWLINE "\r\n"
29#define LOGGER_BUFFER 128
34#define PPCAT_NX(A, B) A##B
35#define PPCAT(A, B) PPCAT_NX(A, B)
36#define STRINGIZE_NX(A) #A
37#define STRINGIZE(A) STRINGIZE_NX(A)
43#define FLT_FMT(_n) STRINGIZE(PPCAT(PPCAT(%c%d.%0, _n), d))
49#define FLT_VAR(_n, _x) \
50 (_x < 0 ? '-' : ' '), (int)(abs(_x)), \
51 (int)(((abs(_x)) - (int)(abs(_x))) * pow(10, (_n)))
55#define FLT_FMT3 FLT_FMT(3)
58#define FLT_VAR3(_x) FLT_VAR(3, _x)
70template <LoggerDestination dest = LOGGER_INTERNAL>
130 while(
nl[
len] !=
'\0')
153template <LoggerDestination dest>
158template <LoggerDestination dest>
161template <LoggerDestination dest>
164template <LoggerDestination dest>
Definition leddriver.h:33
static void PrintLineV(const char *format, va_list va)
Definition logger.h:180
Logger()
Definition logger.h:175
static void Print(const char *format,...)
Definition logger.h:176
static void StartLog(bool wait_for_pc=false)
Definition logger.h:178
static void PrintV(const char *format, va_list va)
Definition logger.h:179
static void PrintLine(const char *format,...)
Definition logger.h:177
Interface for simple USB logging.
Definition logger.h:72
static void AppendNewLine()
static void PrintLineV(const char *format, va_list va)
Logger()
Definition logger.h:76
static void TransmitBuf()
static constexpr size_t NewLineSeqLength()
Definition logger.h:126
static void PrintV(const char *format, va_list va)
static void StartLog(bool wait_for_pc=false)
static void Print(const char *format,...)
LoggerConsts
Definition logger.h:103
@ LOGGER_SYNC_OUT
Definition logger.h:104
@ LOGGER_SYNC_IN
Definition logger.h:105
static void PrintLine(const char *format,...)
static void TransmitSync(const void *buffer, size_t bytes)
Definition logger.h:111
static size_t tx_ptr_
Definition logger.h:141
static LoggerImpl< dest > impl_
Definition logger.h:143
static size_t pc_sync_
Definition logger.h:142
static char tx_buff_[128]
Definition logger.h:140
#define LOGGER_NEWLINE
Definition logger.h:28
#define LOGGER_BUFFER
Definition logger.h:29
Hardware defines and helpers for daisy field platform.
Definition index.h:2
@ LOGGER_NONE
Definition logger_impl.h:16