]> cloudbase.mooo.com Git - z180-stamp.git/blame - avr/strerror.c
Tup: F_CPU per config
[z180-stamp.git] / avr / strerror.c
CommitLineData
414caa77
L
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 "cmd_fat.h"
9
86ee5f8b 10
414caa77 11static const FLASH char * const FLASH error_strings[] = {
86ee5f8b
L
12 FSTR("Unknown error"),
13 FSTR("Not enough memory"),
b35fcb2f 14 FSTR("Interrupt"),
5e8ac5e0
L
15 FSTR("Bus timeout"),
16 FSTR("Unexpected argument"),
17 FSTR("Invalid disk number"),
18 FSTR("Disk already attached"),
19 FSTR("Disk not attached"),
20 FSTR("Error opening file"),
21 FSTR("File already attached to other drive"),
22 FSTR("CPU is running"),
23 FSTR("Invalid argument"),
24 FSTR("Unexpected EOF"),
25
414caa77
L
26};
27
86ee5f8b 28const FLASH char * my_strerror_P(ERRNUM errnum)
414caa77
L
29{
30 if (errnum < 100)
31 return fat_rctostr(errnum);
32
33 errnum -= 100;
414caa77
L
34 if ((unsigned) errnum >= ARRAY_SIZE(error_strings))
35 errnum = 0;
36
37 return error_strings[errnum];
38}