FastLED 3.9.15
Loading...
Searching...
No Matches

◆ arm_tests()

void arm_tests ( )

Definition at line 5 of file arm_test.h.

5 {
6#ifndef FL_IS_ARM
7#error "FL_IS_ARM should be defined for ARM platforms"
8#endif
9
10#if FASTLED_USE_PROGMEM != 0 && FASTLED_USE_PROGMEM != 1
11#error "FASTLED_USE_PROGMEM should be either 0 or 1 for ARM platforms"
12#endif
13
14#if defined(ARDUINO_TEENSYLC) || defined(ARDUINO_TEENSY30) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(ARDUINO_ARCH_RENESAS_UNO) || defined(STM32F1)
15 // Teensy LC, Teensy 3.0, Teensy 3.1/3.2, Renesas UNO, and STM32F1 have limited memory
16 #if SKETCH_HAS_LARGE_MEMORY != 0
17 #error "SKETCH_HAS_LARGE_MEMORY should be 0 for Teensy LC, Teensy 3.0, Teensy 3.1/3.2, Renesas UNO, and STM32F1"
18 #endif
19 #if SKETCH_HAS_HUGE_MEMORY != 0
20 #error "SKETCH_HAS_HUGE_MEMORY should be 0 for Teensy LC, Teensy 3.0, Teensy 3.1/3.2, Renesas UNO, and STM32F1"
21 #endif
22#elif defined(FL_IS_TEENSY_35) || defined(FL_IS_TEENSY_36) || defined(FL_IS_TEENSY_4X) \
23 || defined(ARDUINO_ARCH_RP2040) || defined(PICO_RP2040) || defined(PICO_RP2350) \
24 || defined(__SAMD51__) \
25 || defined(STM32F4xx) || defined(STM32H7xx) || defined(ARDUINO_GIGA)
26 // Huge memory ARM platforms (>= 256KB RAM)
27 #if SKETCH_HAS_LARGE_MEMORY != 1
28 #error "SKETCH_HAS_LARGE_MEMORY should be 1 for huge ARM platforms"
29 #endif
30 #if SKETCH_HAS_HUGE_MEMORY != 1
31 #error "SKETCH_HAS_HUGE_MEMORY should be 1 for huge ARM platforms"
32 #endif
33#else
34 // Most other ARM platforms have large memory but are not "huge"
35 // (e.g., SAMD21, nRF52, generic Cortex-M)
36 #if SKETCH_HAS_LARGE_MEMORY != 1
37 #error "SKETCH_HAS_LARGE_MEMORY should be 1 for most ARM platforms"
38 #endif
39 #if SKETCH_HAS_HUGE_MEMORY != 0
40 #error "SKETCH_HAS_HUGE_MEMORY should be 0 for generic ARM platforms (high tier, not huge)"
41 #endif
42#endif
43
44#if FASTLED_ALLOW_INTERRUPTS != 1 && FASTLED_ALLOW_INTERRUPTS != 0
45#error "FASTLED_ALLOW_INTERRUPTS should be either 0 or 1 for ARM platforms"
46#endif
47
48// Check that F_CPU is defined
49#ifndef F_CPU
50#error "F_CPU should be defined for ARM platforms"
51#endif
52
53// Specific ARM variant checks
54#if defined(ARDUINO_ARCH_STM32) || defined(STM32F1)
55 #if FASTLED_ALLOW_INTERRUPTS != 0
56 #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0"
57 #endif
58 #if FASTLED_USE_PROGMEM != 0
59 #error "STM32 platforms should have FASTLED_USE_PROGMEM set to 0"
60 #endif
61#endif
62
63#if defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_RASPBERRY_PI_PICO)
64 #if FASTLED_USE_PROGMEM != 0
65 #error "RP2040 platforms should have FASTLED_USE_PROGMEM set to 0"
66 #endif
67 #if FASTLED_ALLOW_INTERRUPTS != 1
68 #error "RP2040 platforms should have FASTLED_ALLOW_INTERRUPTS set to 1"
69 #endif
70 #ifdef FASTLED_FORCE_SOFTWARE_SPI
71 // RP2040 forces software SPI - this is expected
72 #endif
73#endif
74
75#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__)
76 // Teensy platforms that use PROGMEM
77 #if FASTLED_USE_PROGMEM != 1
78 #error "Teensy K20/K66/MXRT1062 platforms should have FASTLED_USE_PROGMEM set to 1"
79 #endif
80#endif
81
82#if defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_SAM_DUE)
83 #if FASTLED_USE_PROGMEM != 0
84 #error "SAMD/SAM platforms should have FASTLED_USE_PROGMEM set to 0"
85 #endif
86#endif
87
88#if defined(NRF52_SERIES) || defined(ARDUINO_ARCH_NRF52)
89 #if FASTLED_USE_PROGMEM != 0
90 #error "NRF52 platforms should have FASTLED_USE_PROGMEM set to 0"
91 #endif
92 #ifndef CLOCKLESS_FREQUENCY
93 #error "NRF52 should have CLOCKLESS_FREQUENCY defined"
94 #endif
95#endif
96
97// DEFAULT macro must survive FastLED.h inclusion (used by analogReference)
98#if defined(ARDUINO)
99#ifndef DEFAULT
100#error "DEFAULT macro should be defined after including FastLED.h on ARM Arduino platforms"
101#endif
102#endif
103}