FastLED 3.9.15
Loading...
Searching...
No Matches
stub_main.cpp
Go to the documentation of this file.
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#if defined(FASTLED_STUB_MAIN) || defined(FASTLED_STUB_MAIN_INCLUDE_INO)
12
13#ifndef _FASTLED_STRINGIFY
14#define _FASTLED_STRINGIFY_HELPER(x) #x
15#define _FASTLED_STRINGIFY(x) _FASTLED_STRINGIFY_HELPER(x)
16#endif
17
18#ifdef FASTLED_STUB_MAIN_INCLUDE_INO
19// Correctly include the file by expanding and stringifying the macro value
20#include _FASTLED_STRINGIFY(FASTLED_STUB_MAIN_INCLUDE_INO)
21#else
22void setup() {}
23void loop() {}
24#endif // FASTLED_STUB_MAIN_INCLUDE_INO
25
26#include <iostream>
27
28int main() {
29 // Super simple main function that just calls the setup and loop functions.
30 setup();
31 while (1) {
32 loop();
33 }
34}
35#endif // FASTLED_STUB_MAIN_INCLUDE_INO
void setup()
void loop()
None main()
Definition gen.py:102