64 #ifndef SEGGER_H // Guard against multiple inclusion 70 #if defined(__cplusplus) 87 #define INLINE __forceinline 89 #if (defined(__GNUC__)) 93 #define INLINE inline __attribute__((always_inline)) 94 #elif (defined(__CC_ARM)) 98 #define INLINE __inline 99 #elif (defined(__ICCARM__) || defined(__RX) || defined(__ICCRX__)) 103 #define INLINE inline 120 #define SEGGER_COUNTOF(a) (sizeof((a))/sizeof((a)[0])) 121 #define SEGGER_MIN(a,b) (((a) < (b)) ? (a) : (b)) 122 #define SEGGER_MAX(a,b) (((a) > (b)) ? (a) : (b)) 124 #ifndef SEGGER_USE_PARA // Some compiler complain about unused parameters. 125 #define SEGGER_USE_PARA(Para) (void)Para // This works for most compilers. 135 #define SEGGER_PRINTF_FLAG_ADJLEFT (1 << 0) 136 #define SEGGER_PRINTF_FLAG_SIGNFORCE (1 << 1) 137 #define SEGGER_PRINTF_FLAG_SIGNSPACE (1 << 2) 138 #define SEGGER_PRINTF_FLAG_PRECEED (1 << 3) 139 #define SEGGER_PRINTF_FLAG_ZEROPAD (1 << 4) 140 #define SEGGER_PRINTF_FLAG_NEGATIVE (1 << 5) 157 void (*pfDMB) (void);
158 void (*pfClean) (
void *p,
unsigned NumBytes);
159 void (*pfInvalidate)(
void *p,
unsigned NumBytes);
167 void (*pfFlush)(SEGGER_SNPRINTF_CONTEXT* pContext);
171 void (*pfStoreChar) (
SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext,
char c);
172 int (*pfPrintUnsigned) (
SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, U32 v,
unsigned Base,
char Flags,
int Width,
int Precision);
173 int (*pfPrintInt) (
SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, I32 v,
unsigned Base,
char Flags,
int Width,
int Precision);
176 typedef void (*SEGGER_pFormatter)(
SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext,
const SEGGER_PRINTF_API* pApi, va_list* pParamList,
char Lead,
int Width,
int Precision);
180 SEGGER_pFormatter pfFormatter;
194 void SEGGER_ARM_memcpy(
void* pDest,
const void* pSrc,
int NumBytes);
195 void SEGGER_memcpy (
void* pDest,
const void* pSrc,
int NumBytes);
196 void SEGGER_memxor (
void* pDest,
const void* pSrc,
unsigned NumBytes);
201 int SEGGER_atoi (
const char* s);
202 int SEGGER_isalnum (
int c);
203 int SEGGER_isalpha (
int c);
204 unsigned SEGGER_strlen (
const char* s);
205 int SEGGER_tolower (
int c);
206 int SEGGER_strcasecmp(
const char* sText1,
const char* sText2);
212 void SEGGER_PrintUnsigned(
SEGGER_BUFFER_DESC* pBufferDesc, U32 v,
unsigned Base,
int Precision);
213 void SEGGER_PrintInt (
SEGGER_BUFFER_DESC* pBufferDesc, I32 v,
unsigned Base,
int Precision);
214 int SEGGER_snprintf (
char* pBuffer,
int BufferSize,
const char* sFormat, ...);
215 int SEGGER_vsnprintf (
char* pBuffer,
int BufferSize,
const char* sFormat, va_list ParamList);
216 int SEGGER_vsnprintfEx (SEGGER_SNPRINTF_CONTEXT* pContext,
const char* sFormat, va_list ParamList);
219 void SEGGER_PRINTF_AddDoubleFormatter(
void);
220 void SEGGER_PRINTF_AddIPFormatter (
void);
221 void SEGGER_PRINTF_AddHTMLFormatter (
void);
223 #if defined(__cplusplus) 227 #endif // Avoid multiple inclusion