Arduino Helpers master
Utility library for Arduino
Exit.cpp
Go to the documentation of this file.
1#ifdef ARDUINO
2
3#include "Error.hpp"
4
6
8#if defined(LED_BUILTIN) || (defined(ESP32) && defined(BUILTIN_LED))
9 pinMode(LED_BUILTIN, OUTPUT);
10 while (1) {
11 digitalWrite(LED_BUILTIN, HIGH);
12 delay(50);
13 digitalWrite(LED_BUILTIN, LOW);
14 delay(50);
15 digitalWrite(LED_BUILTIN, HIGH);
16 delay(50);
17 digitalWrite(LED_BUILTIN, LOW);
18 delay(850);
19 }
20#else
21#warning "LED_BUILTIN is not available, so it cannot blink when an error occurs"
22 noInterrupts();
23 while (1)
24 yield();
25#endif
26}
27
29
30#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:7
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
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.