23423952a83cf88e8c86cac042c4ce72c04b8e15
Stefan Schuermans header fix

Stefan Schuermans authored 12 years ago

1) /* flaneth - flash and ethernet
Stefan Schuermans change email address in hea...

Stefan Schuermans authored 12 years ago

2)    Copyright (C) 2007-2012 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans header fix

Stefan Schuermans authored 12 years ago

3)    Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html
4)    a BlinkenArea project - http://www.blinkenarea.org/ */
Stefan Schuermans initial commit after making...

Stefan Schuermans authored 12 years ago

5) 
6) #ifndef INC_debug
7) #define INC_debug
8) 
9) #include <stdio.h>
10) #include <avr/pgmspace.h>
11) 
12) // debug configuration (what to debug)
13) #define DEBUG_INIT 1
14) #define DEBUG_EEPROM 1
15) #define DEBUG_CF 1
16) #define DEBUG_RTL8019 1
17) #define DEBUG_ETHER 1
18) #define DEBUG_ARP 1
19) #define DEBUG_IP 1
20) #define DEBUG_ICMP 1
21) #define DEBUG_UDP 1
22) #define DEBUG_DHCP 1
23) #define DEBUG_TCP 1
24) #define DEBUG_HTTP 1
Stefan Schuermans put filesystem stuff into o...

Stefan Schuermans authored 12 years ago

25) #define DEBUG_APPS 1
Stefan Schuermans iplemented 1st part of BBM...

Stefan Schuermans authored 12 years ago

26) #define DEBUG_APPS_TOOLS 1
27) #define DEBUG_APP_BBM 1
Stefan Schuermans support for reading MAC/IP...

Stefan Schuermans authored 12 years ago

28) #define DEBUG_APP_CFG 1
Stefan Schuermans initial commit after making...

Stefan Schuermans authored 12 years ago

29) 
30) // debug version of printf
31) #ifdef DEBUG
Stefan Schuermans support for reading MAC/IP...

Stefan Schuermans authored 12 years ago

32) #define debug_printf(fmt, arg...) \
Stefan Schuermans added dosfs code to read FA...

Stefan Schuermans authored 12 years ago

33)   do { \
Stefan Schuermans put filesystem stuff into o...

Stefan Schuermans authored 12 years ago

34)     static const PROGMEM char fmt_pgm[] = fmt"\r\n"; \
Stefan Schuermans support for reading MAC/IP...

Stefan Schuermans authored 12 years ago

35)     char fmt_buf[sizeof(fmt_pgm)]; \
Stefan Schuermans make more warnings visible...

Stefan Schuermans authored 12 years ago

36)     for(unsigned int i = 0; i < sizeof( fmt_pgm ); i++) \
Stefan Schuermans support for reading MAC/IP...

Stefan Schuermans authored 12 years ago

37)       fmt_buf[i] = (char)pgm_read_byte_near((uint16_t)fmt_pgm + i); \
38)     printf(fmt_buf, ##arg); \
Stefan Schuermans added dosfs code to read FA...

Stefan Schuermans authored 12 years ago

39)   } while (0)
Stefan Schuermans initial commit after making...

Stefan Schuermans authored 12 years ago

40) #else
41) #define debug_printf( fmt, arg... ) { }
42) #endif
43) 
44) // specialized debug versions of printf
Stefan Schuermans put filesystem stuff into o...

Stefan Schuermans authored 12 years ago

45) #define debug_specialized_printf(enabled, fmt, arg...) do { if(enabled) debug_printf(fmt, ##arg); } while (0)
46) #define debug_init_printf(fmt, arg...) debug_specialized_printf(DEBUG_INIT, "init: "fmt, ##arg)
47) #define debug_eeprom_printf(fmt, arg...) debug_specialized_printf(DEBUG_EEPROM, "eeprom: "fmt, ##arg)
48) #define debug_cf_printf(fmt, arg...) debug_specialized_printf(DEBUG_CF, "cf: "fmt, ##arg)
49) #define debug_rtl8019_printf(fmt, arg...) debug_specialized_printf(DEBUG_RTL8019, "rtl8019: "fmt, ##arg)
50) #define debug_ether_printf(fmt, arg...) debug_specialized_printf(DEBUG_ETHER, "ether: "fmt, ##arg)
51) #define debug_arp_printf(fmt, arg...) debug_specialized_printf(DEBUG_ARP, "arp: "fmt, ##arg)
52) #define debug_ip_printf(fmt, arg...) debug_specialized_printf(DEBUG_IP, "ip: "fmt, ##arg)
53) #define debug_icmp_printf(fmt, arg...) debug_specialized_printf(DEBUG_ICMP, "icmp: "fmt, ##arg)
54) #define debug_udp_printf(fmt, arg...) debug_specialized_printf(DEBUG_UDP, "udp: "fmt, ##arg)
55) #define debug_dhcp_printf(fmt, arg...) debug_specialized_printf(DEBUG_DHCP, "dhcp: "fmt, ##arg)
56) #define debug_tcp_printf(fmt, arg...) debug_specialized_printf(DEBUG_TCP, "tcp: "fmt, ##arg)
57) #define debug_http_printf(fmt, arg...) debug_specialized_printf(DEBUG_HTTP, "http: "fmt, ##arg)
58) #define debug_apps_printf(fmt, arg...) debug_specialized_printf(DEBUG_APPS, "apps: "fmt, ##arg)
Stefan Schuermans iplemented 1st part of BBM...

Stefan Schuermans authored 12 years ago

59) #define debug_apps_tools_printf(fmt, arg...) debug_specialized_printf(DEBUG_APPS_TOOLS, "apps_tools: "fmt, ##arg)
60) #define debug_app_bbm_printf(fmt, arg...) debug_specialized_printf(DEBUG_APP_BBM, "app_bbm: "fmt, ##arg)
Stefan Schuermans support for reading MAC/IP...

Stefan Schuermans authored 12 years ago

61) #define debug_app_cfg_printf(fmt, arg...) debug_specialized_printf(DEBUG_APP_CFG, "app_cfg: "fmt, ##arg)