Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**
sahilmgandhi 18:6a4db94011d3 2 * \file
sahilmgandhi 18:6a4db94011d3 3 *
sahilmgandhi 18:6a4db94011d3 4 * \brief Status code definitions.
sahilmgandhi 18:6a4db94011d3 5 *
sahilmgandhi 18:6a4db94011d3 6 * This file defines various status codes returned by functions,
sahilmgandhi 18:6a4db94011d3 7 * indicating success or failure as well as what kind of failure.
sahilmgandhi 18:6a4db94011d3 8 *
sahilmgandhi 18:6a4db94011d3 9 * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * \asf_license_start
sahilmgandhi 18:6a4db94011d3 12 *
sahilmgandhi 18:6a4db94011d3 13 * \page License
sahilmgandhi 18:6a4db94011d3 14 *
sahilmgandhi 18:6a4db94011d3 15 * Redistribution and use in source and binary forms, with or without
sahilmgandhi 18:6a4db94011d3 16 * modification, are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 17 *
sahilmgandhi 18:6a4db94011d3 18 * 1. Redistributions of source code must retain the above copyright notice,
sahilmgandhi 18:6a4db94011d3 19 * this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 20 *
sahilmgandhi 18:6a4db94011d3 21 * 2. Redistributions in binary form must reproduce the above copyright notice,
sahilmgandhi 18:6a4db94011d3 22 * this list of conditions and the following disclaimer in the documentation
sahilmgandhi 18:6a4db94011d3 23 * and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 24 *
sahilmgandhi 18:6a4db94011d3 25 * 3. The name of Atmel may not be used to endorse or promote products derived
sahilmgandhi 18:6a4db94011d3 26 * from this software without specific prior written permission.
sahilmgandhi 18:6a4db94011d3 27 *
sahilmgandhi 18:6a4db94011d3 28 * 4. This software may only be redistributed and used in connection with an
sahilmgandhi 18:6a4db94011d3 29 * Atmel microcontroller product.
sahilmgandhi 18:6a4db94011d3 30 *
sahilmgandhi 18:6a4db94011d3 31 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
sahilmgandhi 18:6a4db94011d3 32 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
sahilmgandhi 18:6a4db94011d3 33 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
sahilmgandhi 18:6a4db94011d3 34 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
sahilmgandhi 18:6a4db94011d3 35 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
sahilmgandhi 18:6a4db94011d3 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
sahilmgandhi 18:6a4db94011d3 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
sahilmgandhi 18:6a4db94011d3 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
sahilmgandhi 18:6a4db94011d3 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
sahilmgandhi 18:6a4db94011d3 40 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
sahilmgandhi 18:6a4db94011d3 41 * POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 42 *
sahilmgandhi 18:6a4db94011d3 43 * \asf_license_stop
sahilmgandhi 18:6a4db94011d3 44 *
sahilmgandhi 18:6a4db94011d3 45 */
sahilmgandhi 18:6a4db94011d3 46 /*
sahilmgandhi 18:6a4db94011d3 47 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
sahilmgandhi 18:6a4db94011d3 48 */
sahilmgandhi 18:6a4db94011d3 49
sahilmgandhi 18:6a4db94011d3 50 #ifndef STATUS_CODES_H_INCLUDED
sahilmgandhi 18:6a4db94011d3 51 #define STATUS_CODES_H_INCLUDED
sahilmgandhi 18:6a4db94011d3 52
sahilmgandhi 18:6a4db94011d3 53 /* Note: this is a local workaround to avoid a pre-processor clash due to the
sahilmgandhi 18:6a4db94011d3 54 * lwIP macro ERR_TIMEOUT. */
sahilmgandhi 18:6a4db94011d3 55 #if defined(__LWIP_ERR_H__) && defined(ERR_TIMEOUT)
sahilmgandhi 18:6a4db94011d3 56 #if (ERR_TIMEOUT != -3)
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58 /* Internal check to make sure that the later restore of lwIP's ERR_TIMEOUT
sahilmgandhi 18:6a4db94011d3 59 * macro is set to the correct value. Note that it is highly improbable that
sahilmgandhi 18:6a4db94011d3 60 * this value ever changes in lwIP. */
sahilmgandhi 18:6a4db94011d3 61 #error ASF developers: check lwip err.h new value for ERR_TIMEOUT
sahilmgandhi 18:6a4db94011d3 62 #endif
sahilmgandhi 18:6a4db94011d3 63 #undef ERR_TIMEOUT
sahilmgandhi 18:6a4db94011d3 64 #endif
sahilmgandhi 18:6a4db94011d3 65
sahilmgandhi 18:6a4db94011d3 66 /**
sahilmgandhi 18:6a4db94011d3 67 * Status code that may be returned by shell commands and protocol
sahilmgandhi 18:6a4db94011d3 68 * implementations.
sahilmgandhi 18:6a4db94011d3 69 *
sahilmgandhi 18:6a4db94011d3 70 * \note Any change to these status codes and the corresponding
sahilmgandhi 18:6a4db94011d3 71 * message strings is strictly forbidden. New codes can be added,
sahilmgandhi 18:6a4db94011d3 72 * however, but make sure that any message string tables are updated
sahilmgandhi 18:6a4db94011d3 73 * at the same time.
sahilmgandhi 18:6a4db94011d3 74 */
sahilmgandhi 18:6a4db94011d3 75 enum status_code {
sahilmgandhi 18:6a4db94011d3 76 STATUS_OK = 0, //!< Success
sahilmgandhi 18:6a4db94011d3 77 STATUS_ERR_BUSY = 0x19,
sahilmgandhi 18:6a4db94011d3 78 STATUS_ERR_DENIED = 0x1C,
sahilmgandhi 18:6a4db94011d3 79 STATUS_ERR_TIMEOUT = 0x12,
sahilmgandhi 18:6a4db94011d3 80 ERR_IO_ERROR = -1, //!< I/O error
sahilmgandhi 18:6a4db94011d3 81 ERR_FLUSHED = -2, //!< Request flushed from queue
sahilmgandhi 18:6a4db94011d3 82 ERR_TIMEOUT = -3, //!< Operation timed out
sahilmgandhi 18:6a4db94011d3 83 ERR_BAD_DATA = -4, //!< Data integrity check failed
sahilmgandhi 18:6a4db94011d3 84 ERR_PROTOCOL = -5, //!< Protocol error
sahilmgandhi 18:6a4db94011d3 85 ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device
sahilmgandhi 18:6a4db94011d3 86 ERR_NO_MEMORY = -7, //!< Insufficient memory
sahilmgandhi 18:6a4db94011d3 87 ERR_INVALID_ARG = -8, //!< Invalid argument
sahilmgandhi 18:6a4db94011d3 88 ERR_BAD_ADDRESS = -9, //!< Bad address
sahilmgandhi 18:6a4db94011d3 89 ERR_BUSY = -10, //!< Resource is busy
sahilmgandhi 18:6a4db94011d3 90 ERR_BAD_FORMAT = -11, //!< Data format not recognized
sahilmgandhi 18:6a4db94011d3 91 ERR_NO_TIMER = -12, //!< No timer available
sahilmgandhi 18:6a4db94011d3 92 ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running
sahilmgandhi 18:6a4db94011d3 93 ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running
sahilmgandhi 18:6a4db94011d3 94 ERR_ABORTED = -15, //!< Operation aborted by user
sahilmgandhi 18:6a4db94011d3 95 /**
sahilmgandhi 18:6a4db94011d3 96 * \brief Operation in progress
sahilmgandhi 18:6a4db94011d3 97 *
sahilmgandhi 18:6a4db94011d3 98 * This status code is for driver-internal use when an operation
sahilmgandhi 18:6a4db94011d3 99 * is currently being performed.
sahilmgandhi 18:6a4db94011d3 100 *
sahilmgandhi 18:6a4db94011d3 101 * \note Drivers should never return this status code to any
sahilmgandhi 18:6a4db94011d3 102 * callers. It is strictly for internal use.
sahilmgandhi 18:6a4db94011d3 103 */
sahilmgandhi 18:6a4db94011d3 104 OPERATION_IN_PROGRESS = -128,
sahilmgandhi 18:6a4db94011d3 105 };
sahilmgandhi 18:6a4db94011d3 106
sahilmgandhi 18:6a4db94011d3 107 typedef enum status_code status_code_t;
sahilmgandhi 18:6a4db94011d3 108
sahilmgandhi 18:6a4db94011d3 109 #if defined(__LWIP_ERR_H__)
sahilmgandhi 18:6a4db94011d3 110 #define ERR_TIMEOUT -3
sahilmgandhi 18:6a4db94011d3 111 #endif
sahilmgandhi 18:6a4db94011d3 112
sahilmgandhi 18:6a4db94011d3 113 #endif /* STATUS_CODES_H_INCLUDED */