Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gzip support for full OTA possibilitys for 1M build (#1266)
* delete history * add firmware Signed-off-by: Jason2866 <obermeier.johann@googlemail.com> * Delete platformio_override.ini * Update .gitignore * Delete WLED_tasmota_1M.bin * Delete WLED_tasmota_1M.bin.gz * Update platformio.ini * Core 2.7.4.5 * new override * actual firmware * Update user_config_override_sample.h * Delete platformio_override.ini * Delete WLED_tasmota_1M.bin * Delete WLED_tasmota_1M.bin.gz * core 2.7.4.7
- Loading branch information
Showing
13 changed files
with
811 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM gitpod/workspace-full | ||
|
||
USER gitpod | ||
|
||
RUN pip3 install -U platformio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tasks: | ||
- command: platformio run | ||
|
||
image: | ||
file: .gitpod.Dockerfile | ||
|
||
vscode: | ||
extensions: | ||
- ms-vscode.cpptools@0.26.3:u3GsZ5PK12Ddr79vh4TWgQ== | ||
- eamodio.gitlens@10.2.1:e0IYyp0efFqVsrZwsIe8CA== | ||
- Atishay-Jain.All-Autocomplete@0.0.23:fbZNfSpnd8XkAHGfAPS2rA== | ||
- 2gua.rainbow-brackets@0.0.6:Tbu8dTz0i+/bgcKQTQ5b8g== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Import('env') | ||
import os | ||
import shutil | ||
import gzip | ||
|
||
OUTPUT_DIR = "build_output{}".format(os.path.sep) | ||
|
||
def bin_gzip(source, target, env): | ||
variant = str(target[0]).split(os.path.sep)[2] | ||
|
||
# create string with location and file names based on variant | ||
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant) | ||
gzip_file = "{}firmware{}{}.bin.gz".format(OUTPUT_DIR, os.path.sep, variant) | ||
|
||
# check if new target files exist and remove if necessary | ||
if os.path.isfile(gzip_file): os.remove(gzip_file) | ||
|
||
# write gzip firmware file | ||
with open(bin_file,"rb") as fp: | ||
with gzip.open(gzip_file, "wb", compresslevel = 9) as f: | ||
shutil.copyfileobj(fp, f) | ||
|
||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Import('env') | ||
import os | ||
import shutil | ||
|
||
OUTPUT_DIR = "build_output{}".format(os.path.sep) | ||
|
||
def bin_rename_copy(source, target, env): | ||
variant = str(target[0]).split(os.path.sep)[2] | ||
|
||
# check if output directories exist and create if necessary | ||
if not os.path.isdir(OUTPUT_DIR): | ||
os.mkdir(OUTPUT_DIR) | ||
|
||
for d in ['firmware', 'map']: | ||
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)): | ||
os.mkdir("{}{}".format(OUTPUT_DIR, d)) | ||
|
||
# create string with location and file names based on variant | ||
map_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant) | ||
bin_file = "{}firmware{}{}.bin".format(OUTPUT_DIR, os.path.sep, variant) | ||
|
||
# check if new target files exist and remove if necessary | ||
for f in [map_file, bin_file]: | ||
if os.path.isfile(f): | ||
os.remove(f) | ||
|
||
# copy firmware.bin to firmware/<variant>.bin | ||
shutil.copy(str(target[0]), bin_file) | ||
|
||
# copy firmware.map to map/<variant>.map | ||
if os.path.isfile("firmware.map"): | ||
shutil.move("firmware.map", map_file) | ||
|
||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Little convenience script to get an object dump | ||
|
||
Import('env') | ||
|
||
def obj_dump_after_elf(source, target, env): | ||
print("Create firmware.asm") | ||
env.Execute("xtensa-lx106-elf-objdump "+ "-D " + str(target[0]) + " > "+ "${PROGNAME}.asm") | ||
|
||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.elf", [obj_dump_after_elf]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Import('env') | ||
import os | ||
import shutil | ||
|
||
# copy WLED00/user_config_override_sample.h to WLED00/user_config_override.h | ||
if os.path.isfile("wled00/user_config_override.h"): | ||
print ("*** use provided user_config_override.h as planned ***") | ||
else: | ||
shutil.copy("wled00/user_config_override_sample.h", "wled00/user_config_override.h") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Import('env') | ||
|
||
# | ||
# Dump build environment (for debug) | ||
#print env.Dump() | ||
# | ||
|
||
flags = " ".join(env['LINKFLAGS']) | ||
flags = flags.replace("-u _printf_float", "") | ||
flags = flags.replace("-u _scanf_float", "") | ||
newflags = flags.split() | ||
|
||
env.Replace( | ||
LINKFLAGS=newflags | ||
) |
Oops, something went wrong.