This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Exit.cpp
Go to the documentation of this file.
1 #ifdef ARDUINO
2 
3 #include "Error.hpp"
4 #include <Arduino.h>
5 
7 
8 void fatalErrorExit() {
9 #if defined(LED_BUILTIN) || (defined(ESP32) && defined(BUILTIN_LED))
10  pinMode(LED_BUILTIN, OUTPUT);
11  while (1) {
12  digitalWrite(LED_BUILTIN, HIGH);
13  delay(50);
14  digitalWrite(LED_BUILTIN, LOW);
15  delay(50);
16  digitalWrite(LED_BUILTIN, HIGH);
17  delay(50);
18  digitalWrite(LED_BUILTIN, LOW);
19  delay(850);
20  }
21 #else
22 #warning "LED_BUILTIN is not available, so it cannot blink when an error occurs"
23  noInterrupts();
24  while (1)
25  yield();
26 #endif
27 }
28 
30 
31 #endif
fatalErrorExit
void fatalErrorExit()
Function that executes and loops forever, blinking the LED when a fatal error is encountered.
Definition: Exit.cpp:8
Error.hpp
ExtIO::pinMode
void pinMode(pin_t pin, uint8_t mode)
An ExtIO version of the Arduino function.
Definition: ExtendedInputOutput.cpp:34
HIGH
const uint8_t HIGH
Definition: ExtendedInputOutput.hpp:34
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
ExtIO::digitalWrite
void digitalWrite(pin_t pin, uint8_t val)
An ExtIO version of the Arduino function.
Definition: ExtendedInputOutput.cpp:45
LOW
const uint8_t LOW
Definition: ExtendedInputOutput.hpp:35
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
OUTPUT
const uint8_t OUTPUT
Definition: ExtendedInputOutput.hpp:38