agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
debug.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 ykat UG (haftungsbeschraenkt) - All Rights Reserved
3  *
4  * Permission for non-commercial use is hereby granted,
5  * free of charge, without warranty of any kind.
6  */
7 #ifndef ZRTOS_DEBUG_H
8 #define ZRTOS_DEBUG_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #ifdef ZRTOS_DEBUG__CFG_ENABLED
14 
15 #include <zrtos/types.h>
16 
17 #ifdef ZRTOS_DEBUG__CFG_MEMORY_CONSOLE
18 # if ZRTOS_DEBUG__CFG_MEMORY_CONSOLE > 0
19 # include <zrtos/debug_console.h>
20  ZRTOS_DEBUG_CONSOLE__INIT(zrtos_debug__memory_console,ZRTOS_DEBUG__CFG_MEMORY_CONSOLE);
21 # define ZRTOS_DEBUG(fmt,...)\
22  zrtos_debug_console__printf(&zrtos_debug__memory_console,fmt,##__VA_ARGS__)
23 # else
24 # define ZRTOS_DEBUG(fmt,...)
25 # endif
26 #else
27 # define ZRTOS_DEBUG(fmt,...)
28 #endif
29 
30 #ifdef ZRTOS__USE_MEMSET
31 #define zrtos_debug__memset memset
32 #else
33 void *zrtos_debug__memset(void *dest,int value, size_t n){
34  register uint8_t *ptr = (uint8_t *) dest;
35  register uint8_t val = value;
36  while(n--){
37  *ptr++ = val;
38  }
39  return dest;
40 }
41 #endif
42 
43 #define ZRTOS_DEBUG__CODE(code) code
44 
45 #else
46 
47 #define ZRTOS_DEBUG__CODE(code)
48 #define ZRTOS_DEBUG(fmt,...)
49 
50 #endif
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 #endif
#define ZRTOS_DEBUG__CFG_MEMORY_CONSOLE
Definition: cfg.h:21
static uint8_t
Definition: mcp2515.h:159