FastLED 3.7.8
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#ifdef 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// Correctly include the file by expanding and stringifying the macro value
18#include _FASTLED_STRINGIFY(FASTLED_STUB_MAIN_INCLUDE_INO)
19
20#include <iostream>
21
22// XY does mapping to a 1D array. Make it weak so that
23// the user can override it if they have supplied an example
24// in their sketch.
25#pragma weak XY
26uint16_t XY(uint8_t x, uint8_t y) {
27 std::cout << "Warning: XY function not defined. Using stub implementation." << std::endl;
28 return 0;
29}
30
31int main() {
32 // Super simple main function that just calls the setup and loop functions.
33 setup();
34 while(1) {
35 loop();
36 }
37}
38#endif // FASTLED_STUB_MAIN_INCLUDE_INO
uint16_t XY(uint8_t, uint8_t)
Forward declaration of the function "XY" which must be provided by the application for use in two-dim...
Definition Noise.ino:22