]> cloudbase.mooo.com Git - z180-stamp.git/blame - avr/strerror.c
ew debug command: xx busack: Measure time RESET to BUSACK
[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 12 FSTR("Unknown error"),
d66348b4
L
13 FSTR("Not enough memory"), /* 101 */
14 FSTR("Interrupt"), /* 102 */
15 FSTR("Bus timeout"), /* 103 */
16 FSTR("Unexpected argument"), /* 104 */
17 FSTR("Invalid disk number"), /* 105 */
18 FSTR("Disk already attached"), /* 106 */
19 FSTR("Disk not attached"), /* 107 */
20 FSTR("Error opening file"), /* 108 */
21 FSTR("File already attached to other drive"), /* 109 */
22 FSTR("CPU is running"), /* 110 */
23 FSTR("Invalid argument"), /* 111 */
24 FSTR("Unexpected EOF"), /* 112 */
5e8ac5e0 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}