Yihui Xiong
/
Seeed_nRF51822_Motion
initial
mbed-src/common/error.c@0:638edba3adf6, 2016-01-11 (annotated)
- Committer:
- yihui
- Date:
- Mon Jan 11 02:32:24 2016 +0000
- Revision:
- 0:638edba3adf6
initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 0:638edba3adf6 | 1 | /* mbed Microcontroller Library |
yihui | 0:638edba3adf6 | 2 | * Copyright (c) 2006-2013 ARM Limited |
yihui | 0:638edba3adf6 | 3 | * |
yihui | 0:638edba3adf6 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
yihui | 0:638edba3adf6 | 5 | * you may not use this file except in compliance with the License. |
yihui | 0:638edba3adf6 | 6 | * You may obtain a copy of the License at |
yihui | 0:638edba3adf6 | 7 | * |
yihui | 0:638edba3adf6 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
yihui | 0:638edba3adf6 | 9 | * |
yihui | 0:638edba3adf6 | 10 | * Unless required by applicable law or agreed to in writing, software |
yihui | 0:638edba3adf6 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
yihui | 0:638edba3adf6 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
yihui | 0:638edba3adf6 | 13 | * See the License for the specific language governing permissions and |
yihui | 0:638edba3adf6 | 14 | * limitations under the License. |
yihui | 0:638edba3adf6 | 15 | */ |
yihui | 0:638edba3adf6 | 16 | #include <stdlib.h> |
yihui | 0:638edba3adf6 | 17 | #include <stdarg.h> |
yihui | 0:638edba3adf6 | 18 | #include "device.h" |
yihui | 0:638edba3adf6 | 19 | #include "toolchain.h" |
yihui | 0:638edba3adf6 | 20 | #include "mbed_error.h" |
yihui | 0:638edba3adf6 | 21 | #if DEVICE_STDIO_MESSAGES |
yihui | 0:638edba3adf6 | 22 | #include <stdio.h> |
yihui | 0:638edba3adf6 | 23 | #endif |
yihui | 0:638edba3adf6 | 24 | |
yihui | 0:638edba3adf6 | 25 | WEAK void error(const char* format, ...) { |
yihui | 0:638edba3adf6 | 26 | #if DEVICE_STDIO_MESSAGES |
yihui | 0:638edba3adf6 | 27 | va_list arg; |
yihui | 0:638edba3adf6 | 28 | va_start(arg, format); |
yihui | 0:638edba3adf6 | 29 | vfprintf(stderr, format, arg); |
yihui | 0:638edba3adf6 | 30 | va_end(arg); |
yihui | 0:638edba3adf6 | 31 | #endif |
yihui | 0:638edba3adf6 | 32 | exit(1); |
yihui | 0:638edba3adf6 | 33 | } |