/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/*3435@File error.c3637@Description General errors and events reporting utilities.38*//***************************************************************************/39#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))40#include "error_ext.h"414243const char *dbgLevelStrings[] =44{45"CRITICAL"46,"MAJOR"47,"MINOR"48,"WARNING"49,"INFO"50,"TRACE"51};525354char * ErrTypeStrings (e_ErrorType err)55{56switch (err)57{58case (E_OK): return "OK";59case (E_WRITE_FAILED): return "Write Access Failed";60case (E_NO_DEVICE): return "No Device";61case (E_NOT_AVAILABLE): return "Resource Is Unavailable";62case (E_NO_MEMORY): return "Memory Allocation Failed";63case (E_INVALID_ADDRESS): return "Invalid Address";64case (E_BUSY): return "Resource Is Busy";65case (E_ALREADY_EXISTS): return "Resource Already Exists";66case (E_INVALID_OPERATION): return "Invalid Operation";67case (E_INVALID_VALUE): return "Invalid Value";68case (E_NOT_IN_RANGE): return "Value Out Of Range";69case (E_NOT_SUPPORTED): return "Unsupported Operation";70case (E_INVALID_STATE): return "Invalid State";71case (E_INVALID_HANDLE): return "Invalid Handle";72case (E_INVALID_ID): return "Invalid ID";73case (E_NULL_POINTER): return "Unexpected NULL Pointer";74case (E_INVALID_SELECTION): return "Invalid Selection";75case (E_INVALID_COMM_MODE): return "Invalid Communication Mode";76case (E_INVALID_MEMORY_TYPE): return "Invalid Memory Type";77case (E_INVALID_CLOCK): return "Invalid Clock";78case (E_CONFLICT): return "Conflict In Settings";79case (E_NOT_ALIGNED): return "Incorrect Alignment";80case (E_NOT_FOUND): return "Resource Not Found";81case (E_FULL): return "Resource Is Full";82case (E_EMPTY): return "Resource Is Empty";83case (E_ALREADY_FREE): return "Resource Already Free";84case (E_READ_FAILED): return "Read Access Failed";85case (E_INVALID_FRAME): return "Invalid Frame";86case (E_SEND_FAILED): return "Send Operation Failed";87case (E_RECEIVE_FAILED): return "Receive Operation Failed";88case (E_TIMEOUT): return "Operation Timed Out";89default:90break;91}92return NULL;93}94#endif /* (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) */959697