FastLED 3.9.3
Loading...
Searching...
No Matches
stub_main.cpp
1/*
2 * This is a stub implementation of main that can be used to include an *.ino
3 * file which is so close to C++ that many of them can be compiled as C++. The
4 * notable difference between a *.ino file and a *.cpp file is that the *.ino
5 * file does not need to include function prototypes, and are instead
6 * auto-generated.
7*/
8
9
10#if defined(FASTLED_STUB_MAIN) || defined(FASTLED_STUB_MAIN_INCLUDE_INO)
11
12#ifndef _FASTLED_STRINGIFY
13#define _FASTLED_STRINGIFY_HELPER(x) #x
14#define _FASTLED_STRINGIFY(x) _FASTLED_STRINGIFY_HELPER(x)
15#endif
16
17#ifdef FASTLED_STUB_MAIN_INCLUDE_INO
18// Correctly include the file by expanding and stringifying the macro value
19#include _FASTLED_STRINGIFY(FASTLED_STUB_MAIN_INCLUDE_INO)
20#else
21void setup() {}
22void loop() {}
23#endif // FASTLED_STUB_MAIN_INCLUDE_INO
24
25#include <iostream>
26
27int main() {
28 // Super simple main function that just calls the setup and loop functions.
29 setup();
30 while(1) {
31 loop();
32 }
33}
34#endif // FASTLED_STUB_MAIN_INCLUDE_INO