source: asp3_tinet_ecnl_arm/trunk/asp3_dcre/mbed/platform/mbed_error.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

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