Linear Algebra  arduino
Accessible implementations of linear algebra algorithms
ArduinoConfig.hpp
Go to the documentation of this file.
1 #pragma once
2 
9 #ifdef ARDUINO
10 
11 #include "ArduinoMacroFix.hpp"
12 
13 #ifdef AVR
14 
15 #define NO_IOSTREAM_SUPPORT
16 #define NO_RANDOM_SUPPORT
17 
18 #error "AVR has no STL support. Include your third-party STL library here."
19 
20 #elif defined(TEENSYDUINO)
21 
22 #if defined(ARDUINO_TEENSY30) || defined(ARDUINO_TEENSY32) || \
23  defined(ARDUINO_TEENSY35) || defined(ARDUINO_TEENSY36)
24 // Teensy 3.x doesn't support iostream
25 #define NO_IOSTREAM_SUPPORT
26 // The STL is partly broken because of the -fsingle-precision-constant flag
27 #define NO_RANDOM_SUPPORT
28 // The STL is also broken because of the undefnied __throw_xxx() functions
29 // in the funcexcept header
30 #define NO_FUNEXCEPT_DEFINITIONS
31 #else
32 // Teensy 4.x supports iostream and random
33 #endif
34 
35 #else
36 // Assume both Arduino Print and std::ostream support, but
37 // keep in mind that std::cout doesn't work on most boards.
38 #endif
39 
40 #if defined(ARDUINO_ARCH_MBED)
41 // #define ARDUINO_HAS_WORKING_COUT // std::cout writes to Serial1, not Serial
42 #elif defined(ESP32) || defined(ESP8266)
43 #define ARDUINO_HAS_WORKING_COUT
44 #else
45 // std::cout doesn't work (Teensy 4.x, for example)
46 #endif
47 
48 #else // ARDUINO
49 #define NO_ARDUINO_PRINT_SUPPORT
50 #endif
Fixes for problematic macros defined by the Arduino Core.