fremoclock  1_3A01
FREMO Clock - Software for UTG
uart.h
Go to the documentation of this file.
1 
12 #ifndef UART_H_
13 #define UART_H_
14 
15 #include "sysdef.h" // #define SERIAL_OUT_ON
16 #if defined SERIAL_OUT_ON
17  #include <avr/pgmspace.h> // #define PSTR()
18  #include <stdio.h> // printf_P(), printf()
19 #endif
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #if defined(SERIAL_OUT_ON) | defined(__DOXYGEN__)
26 
32  #define LOG_P(FMT, ...) printf_P(PSTR(FMT), ## __VA_ARGS__)
33 
37  #define LOG(FMT, ...) printf(FMT, ## __VA_ARGS__)
38 
39 #else
40  #define LOG_P(FMT, ...) ((void) 0)
41  #define LOG(FMT, ...) ((void) 0)
42 #endif
43 
44 #if defined(SERIAL_OUT_ON) | defined(__DOXYGEN__)
45 
52  void log_init(void);
53 
54 #endif
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif /* UART_H_ */
void log_init(void)
Call once in start of main to initialize logging to uart with LOG() and LOG_P() macros.
System wide Definitions for FREMO Clock.