]> cloudbase.mooo.com Git - z180-stamp.git/blame_incremental - avr/strerror.c
move sys timer setup from main to timer.c
[z180-stamp.git] / avr / strerror.c
... / ...
CommitLineData
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
10
11static const FLASH char * const FLASH error_strings[] = {
12 FSTR("Unknown error"),
13 FSTR("Not enough memory"),
14 FSTR("Interrupt"),
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
26};
27
28const FLASH char * my_strerror_P(ERRNUM errnum)
29{
30 if (errnum < 100)
31 return fat_rctostr(errnum);
32
33 errnum -= 100;
34 if ((unsigned) errnum >= ARRAY_SIZE(error_strings))
35 errnum = 0;
36
37 return error_strings[errnum];
38}