sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
console.h
Go to the documentation of this file.
1 #ifndef CONSOLE_H
2 #define CONSOLE_H
3 
4 #include "pgm.h"
5 #include "features.h"
6 
7 #ifndef P
8 #define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;})
9 #endif
10 
11 #ifdef N_CONSOLE
12 #if N_CONSOLE != 1
13 #error "I only know how to do a single console"
14 #endif
15 
16 void console_init(void);
17 extern void console_putc(unsigned char data);
18 
19 extern void console_puts(const char *s);
20 extern void console_puts_p(const char *s);
21 #define console_puts_P(__s) console_puts_p(P(__s))
22 extern void console_puti(int i);
23 extern void console_putl(long i);
24 extern void console_puthex_nibble(const unsigned char b);
25 extern void console_puthex_byte(const unsigned char b);
26 extern void console_puthex_byte_(const unsigned char b);
27 extern void console_puthex_word(const uint16_t b);
28 
29 extern uint8_t console_buf_len(void);
30 extern uint8_t console_buf_read(unsigned char *addr, uint8_t len);
31 extern void console_buf_done(uint8_t len);
32 
33 #else
34 
35 #define console_init() do{}while(0)
36 #define console_putc(x) do{}while(0)
37 #define console_puts(x) do{}while(0)
38 #define console_puts_p(x) do{}while(0)
39 #define console_puts_P(x) do{}while(0)
40 #define console_puti(x) do{}while(0)
41 #define console_putl(x) do{}while(0)
42 #define console_puthex_nibble(x) do{}while(0)
43 #define console_puthex_byte(x) do{}while(0)
44 #define console_puthex_byte_(x) do{}while(0)
45 #define console_puthex_word(x) do{}while(0)
46 #define console_buf_len() 0
47 #define console_buf_read(x,y) 0
48 #define console_buf_done(y) do{}while(0)
49 
50 #endif // !TC_CONSOLE
51 
52 #define console_alert() (!!console_buf_len())
53 
54 #endif // CONSOLE_H
55 
#define console_buf_read(x, y)
Definition: console.h:47
#define console_puts(x)
Definition: console.h:37
#define console_puthex_word(x)
Definition: console.h:45
#define console_puthex_byte(x)
Definition: console.h:43
byte addr[8]
Definition: OWP_DG_1w-adaptor.ino:104
#define console_putl(x)
Definition: console.h:41
int32_t int16_t b
Definition: IMU.cpp:172
#define console_puti(x)
Definition: console.h:40
tuple s
Definition: ser-mon-AS7265X.py:36
#define console_puthex_nibble(x)
Definition: console.h:42
tuple data
Definition: ser-mon-AS7265X.py:40
#define console_puthex_byte_(x)
Definition: console.h:44
#define console_putc(x)
Definition: console.h:36
#define console_buf_done(y)
Definition: console.h:48
#define console_buf_len()
Definition: console.h:46
#define console_init()
Definition: console.h:35
int i
Definition: ser-log.py:25
#define console_puts_p(x)
Definition: console.h:38