summaryrefslogtreecommitdiffstats
path: root/m168_firmware/errno.c
blob: e4a9e7bc01b6f8785545eb2f8d556ce0f328a611 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 *   Wi-Fi Detector opensource firmware
 *   Error numbers
 *
 *   Copyright (C) 2007 Michael Buesch <mb@bu3sch.de>
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation; either version 2
 *   of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 */

#include "errno.h"
#include "util.h"


const prog_char * errno_string(int8_t err)
{
	if (err < 0)
		err = -err;
	switch (err) {
	case EOK:
		return PSTR("No error");
	case ERXFE:
		return PSTR("USART-RX frame error");
	case ERXPE:
		return PSTR("USART-RX parity error");
	case ERXOV:
		return PSTR("USART-RX overflow");
	case ENODATA:
		return PSTR("No data available");
	case EOVERFLOW:
		return PSTR("Buffer overflow");
	case ETIMEDOUT:
		return PSTR("Timeout");
	case ENOSPC:
		return PSTR("No space left");
	case EINTR:
		return PSTR("Interrupted");
	case EIGNORE:
		return PSTR("Ignored");
	}
	BUG_ON(1);
}
bues.ch cgit interface