]> cloudbase.mooo.com Git - z180-stamp.git/blob - avr/strerror.c
bb151adb5ba63857e80d85aa0178aeeda4537ff0
[z180-stamp.git] / avr / strerror.c
1 /*
2 * (C) Copyright 2018 Leo C. <erbl259-lmu@yahoo.de>
3 *
4 * SPDX-License-Identifier: GPL-2.0
5 */
6
7 #include "common.h"
8 #include "errnum.h"
9 #include "cmd_fat.h"
10
11
12 static const FLASH char * const FLASH error_strings[] = {
13 FSTR("Unknown error"),
14 FSTR("Not enough memory"),
15 FSTR("Bus timeout")
16 };
17
18 const FLASH char * my_strerror_P(ERRNUM errnum)
19 {
20 if (errnum < 100)
21 return fat_rctostr(errnum);
22
23 errnum -= 100;
24 if ((unsigned) errnum >= ARRAY_SIZE(error_strings))
25 errnum = 0;
26
27 return error_strings[errnum];
28 }