Subversion Repositories Projects

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1472 - 1
/*
2
      ___                         ___           ___           ___          _____
3
     /  /\                       /__/\         /  /\         /__/\        /  /::\
4
    /  /::\                     |  |::\       /  /::\        \  \:\      /  /:/\:\
5
   /  /:/\:\    ___     ___     |  |:|:\     /  /:/\:\        \  \:\    /  /:/  \:\
6
  /  /:/~/::\  /__/\   /  /\  __|__|:|\:\   /  /:/  \:\   _____\__\:\  /__/:/ \__\:|
7
 /__/:/ /:/\:\ \  \:\ /  /:/ /__/::::| \:\ /__/:/ \__\:\ /__/::::::::\ \  \:\ /  /:/
8
 \  \:\/:/__\/  \  \:\  /:/  \  \:\~~\__\/ \  \:\ /  /:/ \  \:\~~\~~\/  \  \:\  /:/
9
  \  \::/        \  \:\/:/    \  \:\        \  \:\  /:/   \  \:\  ~~~    \  \:\/:/
10
   \  \:\         \  \::/      \  \:\        \  \:\/:/     \  \:\         \  \::/
11
    \  \:\         \__\/        \  \:\        \  \::/       \  \:\         \__\/
12
     \__\/                       \__\/         \__\/         \__\/
13
      ___           ___           ___           ___           ___           ___
14
     /  /\         /  /\         /__/\         /__/\         /  /\         /__/\
15
    /  /:/        /  /::\       |  |::\       |  |::\       /  /::\        \  \:\
16
   /  /:/        /  /:/\:\      |  |:|:\      |  |:|:\     /  /:/\:\        \  \:\
17
  /  /:/  ___   /  /:/  \:\   __|__|:|\:\   __|__|:|\:\   /  /:/  \:\   _____\__\:\
18
 /__/:/  /  /\ /__/:/ \__\:\ /__/::::| \:\ /__/::::| \:\ /__/:/ \__\:\ /__/::::::::\
19
 \  \:\ /  /:/ \  \:\ /  /:/ \  \:\~~\__\/ \  \:\~~\__\/ \  \:\ /  /:/ \  \:\~~\~~\/
20
  \  \:\  /:/   \  \:\  /:/   \  \:\        \  \:\        \  \:\  /:/   \  \:\  ~~~
21
   \  \:\/:/     \  \:\/:/     \  \:\        \  \:\        \  \:\/:/     \  \:\
22
    \  \::/       \  \::/       \  \:\        \  \:\        \  \::/       \  \:\
23
     \__\/         \__\/         \__\/         \__\/         \__\/         \__\/
24
 
25
 
26
*
27
* Error handling functions.
28
*/
29
 
30
#ifndef __ERROR__
31
#define __ERROR__
32
 
33
#include <avr/pgmspace.h>
34
#include <stdbool.h>
35
#include "main.h"
36
 
37
 
38
void error_init(void);
39
 
40
void error_putc(const char c);
41
 
42
void assert (bool condition, const char *msg);
43
void info (const char *msg);
44
void warn(const char *msg);
45
void debug(const char *msg);
46
void Error(const char *msg);
47
 
48
void assert_pgm(bool condition, const prog_char *msg);
49
void info_pgm (const prog_char *msg);
50
void warn_pgm(const prog_char *msg);
51
void debug_pgm(const prog_char *msg);
52
void error_pgm(const prog_char *msg);
53
 
54
void byte_to_hex(uint8_t byte);
55
 
56
#else
57
 
58
#define error_init() {}
59
 
60
 
61
#define error_putc(c) {}
62
 
63
#define assert(cond, msg) {}
64
#define info(msg) {}
65
#define warn(msg) {}
66
#define debug(msg) {}
67
#define error(msg) {}
68
 
69
#define assert_pgm(cond, msg) {}
70
#define info_pgm(msg) {}
71
#define warn_pgm(msg) {}
72
#define debug_pgm(msg) {}
73
#define error_pgm(msg) {}
74
#define byte_to_hex(byte) {}
75
#endif