/* * Wi-Fi Detector opensource firmware * Error numbers * * Copyright (C) 2007 Michael Buesch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include "errno.h" #include "util.h" const prog_char * errno_string(int8_t err) { if (err < 0) err = -err; switch (err) { case EOK: return PSTR("No error"); case ERXFE: return PSTR("USART-RX frame error"); case ERXPE: return PSTR("USART-RX parity error"); case ERXOV: return PSTR("USART-RX overflow"); case ENODATA: return PSTR("No data available"); case EOVERFLOW: return PSTR("Buffer overflow"); case ETIMEDOUT: return PSTR("Timeout"); case ENOSPC: return PSTR("No space left"); case EINTR: return PSTR("Interrupted"); case EIGNORE: return PSTR("Ignored"); } BUG_ON(1); }