Control Surface  1.1.1
MIDI Control Surface library for Arduino
AH/Settings/SettingsWrapper.hpp
Go to the documentation of this file.
1 #ifndef AH_SETTINGSWRAPPER_HPP
2 #define AH_SETTINGSWRAPPER_HPP
3 
5 AH_DIAGNOSTIC_WERROR() // Enable errors on warnings
6 
7 // ---- User Settings ---- //
8 // ======================= //
9 #include "NamespaceSettings.hpp"
10 #include "Settings.hpp"
11 
12 #define AH_IS_EMPTY_HELPER(x) x##1
13 #define AH_IS_EMPTY(x) AH_IS_EMPTY_HELPER(x) == 1
14 
15 #if AH_IS_EMPTY(DEBUG_OUT)
16 #undef DEBUG_OUT
17 #endif
18 
19 #ifndef ARDUINO
20 #ifdef DEBUG_OUT
21 #undef DEBUG_OUT
22 #ifndef NO_DEBUG_PRINTS
23 #define DEBUG_OUT std::cout
24 #endif
25 #endif
26 #endif
27 
28 #ifdef AH_INDIVIDUAL_BUTTON_INVERT
29 #define AH_INDIVIDUAL_BUTTON_INVERT_STATIC
30 #else
31 #define AH_INDIVIDUAL_BUTTON_INVERT_STATIC static
32 #endif
33 
34 #ifdef TEENSYDUINO
36 #if defined(DEBUG_OUT) && (DEBUG_OUT == Serial) && \
37  !defined(TEENSY_SERIALUSB_ENABLED)
38 #error \
39  "Debugging is enabled on the CDC Serial port, but the USB type doesn't support Serial"
40 #endif
41 #endif
42 
44 static_assert(
45  sizeof(ANALOG_FILTER_TYPE) * CHAR_BIT >=
47  "ANALOG_FILTER_TYPE isn't wide enough to satisfy filter requirements. \n"
48  "Either decrease the ADC resolution, decrease the filter shift factor, or"
49  "use a wider type (e.g. uint32_t)");
51 
52 // ------- Debug ------- //
53 // ===================== //
54 #include <AH/Debug/Debug.hpp>
55 
57 
58 #endif // AH_SETTINGSWRAPPER_HPP
Warnings.hpp
AH::ANALOG_FILTER_SHIFT_FACTOR
constexpr uint8_t ANALOG_FILTER_SHIFT_FACTOR
The factor for the analog filter: Difference equation: where .
Definition: AH/Settings/Settings.hpp:64
AH_DIAGNOSTIC_POP
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:17
AH::ADC_BITS
constexpr uint8_t ADC_BITS
The bit depth to use for the ADC (Analog to Digital Converter).
Definition: AH/Settings/Settings.hpp:53
TeensyUSBTypes.hpp
Settings.hpp
All user settings and debugging options can be changed here.
AH::ANALOG_FILTER_TYPE
uint16_t ANALOG_FILTER_TYPE
The unsigned integer type to use for analog inputs during filtering.
Definition: AH/Settings/Settings.hpp:71
AH_DIAGNOSTIC_WERROR
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:16
Debug.hpp
BEGIN_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
Definition: AH/Settings/NamespaceSettings.hpp:9
END_AH_NAMESPACE
#define END_AH_NAMESPACE
Definition: AH/Settings/NamespaceSettings.hpp:10