]>
Commit | Line | Data |
---|---|---|
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 | 11 | static const FLASH char * const FLASH error_strings[] = { |
86ee5f8b L |
12 | FSTR("Unknown error"), |
13 | FSTR("Not enough memory"), | |
5e8ac5e0 L |
14 | FSTR("Bus timeout"), |
15 | FSTR("Unexpected argument"), | |
16 | FSTR("Invalid disk number"), | |
17 | FSTR("Disk already attached"), | |
18 | FSTR("Disk not attached"), | |
19 | FSTR("Error opening file"), | |
20 | FSTR("File already attached to other drive"), | |
21 | FSTR("CPU is running"), | |
22 | FSTR("Invalid argument"), | |
23 | FSTR("Unexpected EOF"), | |
24 | ||
414caa77 L |
25 | }; |
26 | ||
86ee5f8b | 27 | const FLASH char * my_strerror_P(ERRNUM errnum) |
414caa77 L |
28 | { |
29 | if (errnum < 100) | |
30 | return fat_rctostr(errnum); | |
31 | ||
32 | errnum -= 100; | |
414caa77 L |
33 | if ((unsigned) errnum >= ARRAY_SIZE(error_strings)) |
34 | errnum = 0; | |
35 | ||
36 | return error_strings[errnum]; | |
37 | } |