FastLED 3.9.7
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// This can't be in the namespace fl. It needs to be in the global namespace.
10
11
12#if defined(FASTLED_STUB_MAIN) || defined(FASTLED_STUB_MAIN_INCLUDE_INO)
13
14#ifndef _FASTLED_STRINGIFY
15#define _FASTLED_STRINGIFY_HELPER(x) #x
16#define _FASTLED_STRINGIFY(x) _FASTLED_STRINGIFY_HELPER(x)
17#endif
18
19#ifdef FASTLED_STUB_MAIN_INCLUDE_INO
20// Correctly include the file by expanding and stringifying the macro value
21#include _FASTLED_STRINGIFY(FASTLED_STUB_MAIN_INCLUDE_INO)
22#else
23void setup() {}
24void loop() {}
25#endif // FASTLED_STUB_MAIN_INCLUDE_INO
26
27#include <iostream>
28
29int main() {
30 // Super simple main function that just calls the setup and loop functions.
31 setup();
32 while(1) {
33 loop();
34 }
35}
36#endif // FASTLED_STUB_MAIN_INCLUDE_INO