| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * errors.h | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  Created on: Nov 27, 2012 | 
					
						
							| 
									
										
										
										
											2012-11-29 17:52:57 +07:00
										 |  |  |  *      Author: hathach | 
					
						
							| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Software License Agreement (BSD License) | 
					
						
							| 
									
										
										
										
											2013-01-27 13:50:40 +07:00
										 |  |  |  * Copyright (c) 2013, hathach (tinyusb.net) | 
					
						
							| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Redistribution and use in source and binary forms, with or without modification, | 
					
						
							|  |  |  |  * are permitted provided that the following conditions are met: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 1. Redistributions of source code must retain the above copyright notice, | 
					
						
							|  |  |  |  *    this list of conditions and the following disclaimer. | 
					
						
							|  |  |  |  * 2. Redistributions in binary form must reproduce the above copyright notice, | 
					
						
							|  |  |  |  *    this list of conditions and the following disclaimer in the documentation | 
					
						
							|  |  |  |  *    and/or other materials provided with the distribution. | 
					
						
							|  |  |  |  * 3. The name of the author may not be used to endorse or promote products | 
					
						
							|  |  |  |  *    derived from this software without specific prior written permission. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | 
					
						
							|  |  |  |  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | 
					
						
							|  |  |  |  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT | 
					
						
							|  |  |  |  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 
					
						
							|  |  |  |  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT | 
					
						
							|  |  |  |  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 
					
						
							|  |  |  |  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 
					
						
							|  |  |  |  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 
					
						
							|  |  |  |  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | 
					
						
							|  |  |  |  * OF SUCH DAMAGE. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-12-02 00:36:44 +07:00
										 |  |  |  * This file is part of the tinyUSB stack. | 
					
						
							| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-29 10:41:33 +07:00
										 |  |  | /** \file
 | 
					
						
							|  |  |  |  *  \brief Error Header | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *  \note TBD | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** \ingroup Group_Common
 | 
					
						
							| 
									
										
										
										
											2012-12-03 16:51:14 +07:00
										 |  |  |  *  \defgroup Group_Error Error Codes | 
					
						
							| 
									
										
										
										
											2012-11-29 10:41:33 +07:00
										 |  |  |  *  @{ | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  | #ifndef _TUSB_ERRORS_H_
 | 
					
						
							|  |  |  | #define _TUSB_ERRORS_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-28 15:03:18 +07:00
										 |  |  | #include "tusb_option.h"
 | 
					
						
							| 
									
										
										
										
											2012-12-20 16:56:19 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-02 11:07:59 +07:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  |  extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-11 16:28:57 +07:00
										 |  |  | #define ERROR_ENUM(x) x,
 | 
					
						
							|  |  |  | #define ERROR_STRING(x) #x,
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define ERROR_TABLE(ENTRY) \
 | 
					
						
							| 
									
										
										
										
											2013-01-19 00:57:58 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_NONE)\ | 
					
						
							| 
									
										
										
										
											2013-01-22 17:41:06 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_INVALID_PARA)\ | 
					
						
							| 
									
										
										
										
											2013-01-27 17:57:35 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_DEVICE_NOT_READY)\ | 
					
						
							| 
									
										
										
										
											2013-01-22 17:41:06 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_CLASS_DEVICE_DONT_SUPPORT)\ | 
					
						
							| 
									
										
										
										
											2013-01-26 01:37:15 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_CLASS_DATA_NOT_AVAILABLE)\ | 
					
						
							| 
									
										
										
										
											2013-02-01 10:33:43 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_HCD_FAILED)\ | 
					
						
							| 
									
										
										
										
											2013-02-06 13:50:17 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND)\ | 
					
						
							| 
									
										
										
										
											2013-02-06 18:12:26 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_USBH_MOUNT_CONFIG_DESC_TOO_LONG)\ | 
					
						
							| 
									
										
										
										
											2013-01-22 17:41:06 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_OSAL_TIMEOUT)\ | 
					
						
							| 
									
										
										
										
											2013-02-26 17:28:05 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_OSAL_WAITING)\ | 
					
						
							| 
									
										
										
										
											2013-01-31 13:11:50 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_OSAL_TASK_FAILED)\ | 
					
						
							| 
									
										
										
										
											2013-01-29 11:06:30 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_OSAL_QUEUE_FAILED)\ | 
					
						
							| 
									
										
										
										
											2013-02-04 18:05:22 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_OSAL_SEMAPHORE_FAILED)\ | 
					
						
							| 
									
										
										
										
											2013-03-07 17:59:07 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_EHCI_NOT_ENOUGH_QTD)\ | 
					
						
							| 
									
										
										
										
											2013-01-22 17:41:06 +07:00
										 |  |  |     ENTRY(TUSB_ERROR_FAILED)\ | 
					
						
							| 
									
										
										
										
											2013-01-11 16:28:57 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-19 00:57:58 +07:00
										 |  |  | /** \enum tusb_error_t
 | 
					
						
							| 
									
										
										
										
											2012-11-29 15:35:59 +07:00
										 |  |  |  *  \brief Error Code returned | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | typedef enum { | 
					
						
							| 
									
										
										
										
											2013-01-11 16:28:57 +07:00
										 |  |  |   ERROR_TABLE(ERROR_ENUM) | 
					
						
							| 
									
										
										
										
											2013-01-22 17:41:06 +07:00
										 |  |  |   TUSB_ERROR_COUNT | 
					
						
							| 
									
										
										
										
											2013-01-19 00:57:58 +07:00
										 |  |  | }tusb_error_t; | 
					
						
							| 
									
										
										
										
											2012-11-29 10:41:33 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-20 16:56:19 +07:00
										 |  |  | #if TUSB_CFG_DEBUG == 3
 | 
					
						
							|  |  |  | /// Enum to String for debugging purposes. Only available if \ref TUSB_CFG_DEBUG > 0
 | 
					
						
							| 
									
										
										
										
											2013-01-27 12:38:06 +07:00
										 |  |  | extern uint8_t const* const TUSB_ErrorStr[]; | 
					
						
							| 
									
										
										
										
											2012-12-20 16:56:19 +07:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2012-11-27 15:35:57 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  |  } | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2012-11-27 15:21:47 +07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif /* _TUSB_ERRORS_H_ */
 | 
					
						
							| 
									
										
										
										
											2012-11-29 15:35:59 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-11-29 15:40:57 +07:00
										 |  |  |  /**  @} */ |