Skip to content

Commit 12c1e04

Browse files
authored
Merge pull request #212 from henrygab/platformio
Enable PlatformIO
2 parents d96ca3a + 27682e7 commit 12c1e04

File tree

10 files changed

+375
-21
lines changed

10 files changed

+375
-21
lines changed

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ build/
44
buildcache/
55
arduino.json
66
c_cpp_properties.json
7-
.vscode
87

9-
/platformio-override.ini
10-
/release/
8+
/.vscode/
9+
/release
10+
/platformio_override.ini
11+
/.pio/
12+
/esp8266-fastled-webserver/esp8266-fastled-webserver.ino.cpp

esp8266-fastled-webserver/common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#include <FastLED.h>
3232
FASTLED_USING_NAMESPACE
3333

34-
extern "C" {
35-
#include "user_interface.h"
36-
}
37-
3834
#include <LittleFS.h>
3935
#define MYFS LittleFS
4036

esp8266-fastled-webserver/config.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@
2424
// When compiling from Arduino, you can edit this file.
2525
// When compiling from PlatformIO, this is a reference for compiler flags.
2626

27-
#define PRODUCT_DEFAULT
28-
// #define PRODUCT_FIBONACCI512
29-
// #define PRODUCT_FIBONACCI256
30-
// #define PRODUCT_FIBONACCI128
31-
// #define PRODUCT_FIBONACCI64_FULL // 86mm, WS2812B-5050, ~60mA/pixel
32-
// #define PRODUCT_FIBONACCI64_MINI // 64mm, WS2812B-3535, ~60mA/pixel
33-
// #define PRODUCT_FIBONACCI64_MICRO // 40mm, WS2812C-2020, ~5mA/pixel
34-
// #define PRODUCT_FIBONACCI64_NANO // 33mm, SK6805-EC15, ~5mA/pixel
35-
// #define PRODUCT_FIBONACCI32
36-
// #define PRODUCT_KRAKEN64
37-
// #define PRODUCT_ESP8266_THING // aka parallel (6-output)
38-
// #define PRODUCT_1628_RINGS
27+
#if !defined(BUILDING_USING_PLATFORMIO)
28+
#define PRODUCT_DEFAULT
29+
// #define PRODUCT_FIBONACCI512
30+
// #define PRODUCT_FIBONACCI256
31+
// #define PRODUCT_FIBONACCI128
32+
// #define PRODUCT_FIBONACCI64_FULL // 86mm, WS2812B-5050, ~60mA/pixel
33+
// #define PRODUCT_FIBONACCI64_MINI // 64mm, WS2812B-3535, ~60mA/pixel
34+
// #define PRODUCT_FIBONACCI64_MICRO // 40mm, WS2812C-2020, ~5mA/pixel
35+
// #define PRODUCT_FIBONACCI64_NANO // 33mm, SK6805-EC15, ~5mA/pixel
36+
// #define PRODUCT_FIBONACCI32
37+
// #define PRODUCT_KRAKEN64
38+
// #define PRODUCT_ESP8266_THING // aka parallel (6-output)
39+
// #define PRODUCT_1628_RINGS
40+
#endif /// !defined(BUILDING_USING_PLATFORMIO)
41+
3942

4043
// ////////////////////////////////////////////////////////////////////////////////////////////////////
4144
// Additional configuration options ... defaults shown

esp8266-fastled-webserver/esp8266-fastled-webserver.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ const PatternAndName patterns[] = {
110110
#endif
111111

112112
{ colorWaves, "Color Waves" },
113+
#if IS_FIBONACCI
114+
{ colorWavesFibonacci, "Color Waves Fibonacci" },
115+
#endif
113116

114117
#if HAS_COORDINATE_MAP // really a wrong name... and likely doing way more computation than necessary
115118
{ radarSweepPalette, "Radar Sweep Palette" },
@@ -132,8 +135,6 @@ const PatternAndName patterns[] = {
132135
#endif
133136

134137
#if IS_FIBONACCI
135-
{ colorWavesFibonacci, "Color Waves Fibonacci" },
136-
137138
{ pridePlayground, "Pride Playground" },
138139
{ pridePlaygroundFibonacci, "Pride Playground Fibonacci" },
139140

include/README

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the usual convention is to give header files names that end with `.h'.
29+
It is most portable to use only letters, digits, dashes, and underscores in
30+
header file names, and at most one dot.
31+
32+
Read more about using header files in official GCC documentation:
33+
34+
* Include Syntax
35+
* Include Operation
36+
* Once-Only Headers
37+
* Computed Includes
38+
39+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

lib/README

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into executable file.
4+
5+
The source code of each library should be placed in a an own separate directory
6+
("lib/your_library_name/[here are source files]").
7+
8+
For example, see a structure of the following two libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
and a contents of `src/main.c`:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html

pio-scripts/obj-dump.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Little convenience script to get an object dump
2+
3+
Import('env')
4+
5+
def obj_dump_after_elf(source, target, env):
6+
print("Create firmware.asm")
7+
env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm")
8+
9+
env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf])

pio-scripts/strip-floats.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Import('env')
2+
3+
#
4+
# Dump build environment (for debug)
5+
#print env.Dump()
6+
#
7+
8+
flags = " ".join(env['LINKFLAGS'])
9+
flags = flags.replace("-u _printf_float", "")
10+
flags = flags.replace("-u _scanf_float", "")
11+
newflags = flags.split()
12+
13+
env.Replace(
14+
LINKFLAGS=newflags
15+
)

0 commit comments

Comments
 (0)