Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sun May 14 23:18:57 2017 +0000
Revision:
18:6a4db94011d3
Publishing again

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1
sahilmgandhi 18:6a4db94011d3 2 /** \addtogroup platform */
sahilmgandhi 18:6a4db94011d3 3 /** @{*/
sahilmgandhi 18:6a4db94011d3 4 /* mbed Microcontroller Library
sahilmgandhi 18:6a4db94011d3 5 * Copyright (c) 2006-2013 ARM Limited
sahilmgandhi 18:6a4db94011d3 6 *
sahilmgandhi 18:6a4db94011d3 7 * Licensed under the Apache License, Version 2.0 (the "License");
sahilmgandhi 18:6a4db94011d3 8 * you may not use this file except in compliance with the License.
sahilmgandhi 18:6a4db94011d3 9 * You may obtain a copy of the License at
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * http://www.apache.org/licenses/LICENSE-2.0
sahilmgandhi 18:6a4db94011d3 12 *
sahilmgandhi 18:6a4db94011d3 13 * Unless required by applicable law or agreed to in writing, software
sahilmgandhi 18:6a4db94011d3 14 * distributed under the License is distributed on an "AS IS" BASIS,
sahilmgandhi 18:6a4db94011d3 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
sahilmgandhi 18:6a4db94011d3 16 * See the License for the specific language governing permissions and
sahilmgandhi 18:6a4db94011d3 17 * limitations under the License.
sahilmgandhi 18:6a4db94011d3 18 */
sahilmgandhi 18:6a4db94011d3 19 #ifndef MBED_ERROR_H
sahilmgandhi 18:6a4db94011d3 20 #define MBED_ERROR_H
sahilmgandhi 18:6a4db94011d3 21
sahilmgandhi 18:6a4db94011d3 22 /** To generate a fatal compile-time error, you can use the pre-processor #error directive.
sahilmgandhi 18:6a4db94011d3 23 *
sahilmgandhi 18:6a4db94011d3 24 * @code
sahilmgandhi 18:6a4db94011d3 25 * #error "That shouldn't have happened!"
sahilmgandhi 18:6a4db94011d3 26 * @endcode
sahilmgandhi 18:6a4db94011d3 27 *
sahilmgandhi 18:6a4db94011d3 28 * If the compiler evaluates this line, it will report the error and stop the compile.
sahilmgandhi 18:6a4db94011d3 29 *
sahilmgandhi 18:6a4db94011d3 30 * For example, you could use this to check some user-defined compile-time variables:
sahilmgandhi 18:6a4db94011d3 31 *
sahilmgandhi 18:6a4db94011d3 32 * @code
sahilmgandhi 18:6a4db94011d3 33 * #define NUM_PORTS 7
sahilmgandhi 18:6a4db94011d3 34 * #if (NUM_PORTS > 4)
sahilmgandhi 18:6a4db94011d3 35 * #error "NUM_PORTS must be less than 4"
sahilmgandhi 18:6a4db94011d3 36 * #endif
sahilmgandhi 18:6a4db94011d3 37 * @endcode
sahilmgandhi 18:6a4db94011d3 38 *
sahilmgandhi 18:6a4db94011d3 39 * Reporting Run-Time Errors:
sahilmgandhi 18:6a4db94011d3 40 * To generate a fatal run-time error, you can use the mbed error() function.
sahilmgandhi 18:6a4db94011d3 41 *
sahilmgandhi 18:6a4db94011d3 42 * @code
sahilmgandhi 18:6a4db94011d3 43 * error("That shouldn't have happened!");
sahilmgandhi 18:6a4db94011d3 44 * @endcode
sahilmgandhi 18:6a4db94011d3 45 *
sahilmgandhi 18:6a4db94011d3 46 * If the mbed running the program executes this function, it will print the
sahilmgandhi 18:6a4db94011d3 47 * message via the USB serial port, and then die with the blue lights of death!
sahilmgandhi 18:6a4db94011d3 48 *
sahilmgandhi 18:6a4db94011d3 49 * The message can use printf-style formatting, so you can report variables in the
sahilmgandhi 18:6a4db94011d3 50 * message too. For example, you could use this to check a run-time condition:
sahilmgandhi 18:6a4db94011d3 51 *
sahilmgandhi 18:6a4db94011d3 52 * @code
sahilmgandhi 18:6a4db94011d3 53 * if(x >= 5) {
sahilmgandhi 18:6a4db94011d3 54 * error("expected x to be less than 5, but got %d", x);
sahilmgandhi 18:6a4db94011d3 55 * }
sahilmgandhi 18:6a4db94011d3 56 * #endcode
sahilmgandhi 18:6a4db94011d3 57 */
sahilmgandhi 18:6a4db94011d3 58
sahilmgandhi 18:6a4db94011d3 59 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 60 extern "C" {
sahilmgandhi 18:6a4db94011d3 61 #endif
sahilmgandhi 18:6a4db94011d3 62
sahilmgandhi 18:6a4db94011d3 63 void error(const char* format, ...);
sahilmgandhi 18:6a4db94011d3 64
sahilmgandhi 18:6a4db94011d3 65 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 66 }
sahilmgandhi 18:6a4db94011d3 67 #endif
sahilmgandhi 18:6a4db94011d3 68
sahilmgandhi 18:6a4db94011d3 69 #endif
sahilmgandhi 18:6a4db94011d3 70
sahilmgandhi 18:6a4db94011d3 71 /** @}*/