Naze32 clone with Frysky receiver
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mbed_error.h 1.9KB

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