Arduino Filters master
Filter library for Arduino
Exit.cpp
Go to the documentation of this file.
1#ifdef ARDUINO
2
4AH_DIAGNOSTIC_WERROR() // Enable errors on warnings
5
6#include "Error.hpp"
7
9
11#if defined(LED_BUILTIN) || (defined(ESP32) && defined(BUILTIN_LED))
12 pinMode(LED_BUILTIN, OUTPUT);
13 while (1) {
14 digitalWrite(LED_BUILTIN, HIGH);
15 delay(50);
16 digitalWrite(LED_BUILTIN, LOW);
17 delay(50);
18 digitalWrite(LED_BUILTIN, HIGH);
19 delay(50);
20 digitalWrite(LED_BUILTIN, LOW);
21 delay(850);
22 }
23#else
24#warning "LED_BUILTIN is not available, so it cannot blink when an error occurs"
25 noInterrupts();
26 while (1)
27 yield();
28#endif
29}
30
32
34
35#endif
constexpr PinStatus_t LOW
constexpr PinStatus_t HIGH
constexpr PinMode_t OUTPUT
void fatalErrorExit()
Function that executes and loops forever, blinking the built-in LED when a fatal error is encountered...
Definition: Exit.cpp:10
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:36
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:35
void pinMode(pin_t pin, PinMode_t mode)
An ExtIO version of the Arduino function.
void digitalWrite(pin_t pin, PinStatus_t val)
An ExtIO version of the Arduino function.