Open Garden  0.10.1-21
debug.h
Go to the documentation of this file.
1 /* This file is part of OpenGarden
2  * Copyright (C) 2011-2014 Enrico Rossi
3  *
4  * OpenGarden is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * OpenGarden is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
22 #ifndef DBG_H
23 #define DBG_H
24 
25 #include <avr/pgmspace.h>
26 #include "uart.h"
27 
32 #define QUOTEME_(x) #x
33 
34 #define QUOTEME(x) QUOTEME_(x)
35 
37 #define MAX_LINE_LENGHT 80
38 
42 #define MAX_STRING_LENGHT 20
43 
45 #define PRINT_VALUE_X_LINE 16
46 
48 #define SEC_FOR_Y 5
49 
51 #ifndef GITREL
52 #define GITREL "unknown"
53 #endif
54 
59 struct debug_t {
61  char *line;
63  char *string;
65  uint8_t active;
66 };
67 
68 void debug_get_str(char *str);
69 void debug_print_P(PGM_P string, struct debug_t *debug);
70 void debug_print(struct debug_t *debug);
71 void debug_version(struct debug_t *debug);
72 uint8_t debug_wait_for_y(struct debug_t *debug);
73 void debug_start(struct debug_t *debug);
74 void debug_stop(struct debug_t *debug);
75 struct debug_t *debug_init(struct debug_t *debug);
76 void debug_free(struct debug_t *debug);
77 
78 #endif
struct debug_t * debug_init(struct debug_t *debug)
Definition: debug.c:128
RS232 - IO functions.
char * string
Definition: debug.h:63
char * line
Definition: debug.h:61
Definition: debug.h:59
void debug_version(struct debug_t *debug)
Definition: debug.c:67
void debug_print_P(PGM_P string, struct debug_t *debug)
Definition: debug.c:51
uint8_t debug_wait_for_y(struct debug_t *debug)
Definition: debug.c:87
void debug_free(struct debug_t *debug)
Definition: debug.c:138
void debug_print(struct debug_t *debug)
Definition: debug.c:60
void debug_stop(struct debug_t *debug)
Definition: debug.c:119
uint8_t active
Definition: debug.h:65
void debug_get_str(char *str)
Definition: debug.c:26
void debug_start(struct debug_t *debug)
Definition: debug.c:111