OneWay  3.0-3-ge9d4fa4
debug.h
Go to the documentation of this file.
1 /* This file is part of OneWay
2  * Copyright (C) 2011 Enrico Rossi
3  *
4  * OneWay 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  * OneWay 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 #include "htv.h"
28 
30 #define QUOTEME_(x) #x
31 
32 #define QUOTEME(x) QUOTEME_(x)
33 
35 #define MAX_LINE_LENGHT 80
36 
40 #define MAX_STRING_LENGHT 80
41 
43 #define PRINT_VALUE_X_LINE 16
44 
45 #define SEC_FOR_Y 5
46 
52 struct debug_t {
54  char *line;
56  char *string;
58  uint8_t active;
59 };
60 
61 void debug_print_P(PGM_P string, struct debug_t *debug);
62 void debug_print(struct debug_t *debug);
63 uint8_t debug_wait_for_y(struct debug_t *debug);
64 struct debug_t *debug_init(void);
65 void debug_free(struct debug_t *debug);
66 void debug_print_htv(struct htv_t *htv, struct debug_t *debug);
67 void debug_setup_address(struct htv_t *htv, struct debug_t *debug);
68 void debug_print_address(struct htv_t *htv, struct debug_t *debug);
69 
70 #endif
Definition: htv.h:41
void debug_setup_address(struct htv_t *htv, struct debug_t *debug)
input and store the address of the unit in EEPROM.
Definition: debug.c:167
char * string
Definition: debug.h:56
struct debug_t * debug_init(void)
initialize debug struct and uart console
Definition: debug.c:85
char * line
Definition: debug.h:54
void debug_print_address(struct htv_t *htv, struct debug_t *debug)
print the RX address in use.
Definition: debug.c:156
Definition: debug.h:52
Main struct of the project and eventually defaults.
void debug_print_P(PGM_P string, struct debug_t *debug)
Definition: debug.c:33
uint8_t debug_wait_for_y(struct debug_t *debug)
press &#39;y&#39; or &#39;n&#39;
Definition: debug.c:61
void debug_free(struct debug_t *debug)
free the memory
Definition: debug.c:112
void debug_print(struct debug_t *debug)
Definition: debug.c:42
void debug_print_htv(struct htv_t *htv, struct debug_t *debug)
print the struct htv contents.
Definition: debug.c:127
uint8_t active
Definition: debug.h:58