forked from ewowi/StarBase
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'ewowi/main'
- Loading branch information
Showing
13 changed files
with
96 additions
and
20 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
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
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
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
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
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 |
---|---|---|
|
@@ -9,14 +9,6 @@ | |
@license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
*/ | ||
|
||
// remove latest commit | ||
// git reset --hard HEAD^ | ||
// git push origin -f | ||
|
||
#warning ****************************************************************************************************************************** | ||
#warning ********** STARMOD IS LICENSED UNDER GPL-V3. BY INSTALLING STARMOD YOU IMPLICITLY ACCEPT THE TERMS AND CONDITIONS ******** | ||
#warning ****************************************************************************************************************************** | ||
|
||
#include "SysModule.h" | ||
#include "SysModules.h" | ||
#include "Sys/SysModPrint.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
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,64 @@ | ||
# @title StarMod | ||
# @file post_build.py | ||
# @date 20240411 | ||
# @repo https://github.com/ewowi/StarMod, submit changes to this file as PRs to ewowi/StarMod | ||
# @Authors https://github.com/ewowi/StarMod/commits/main | ||
# @Copyright © 2024 Github StarMod Commit Authors | ||
# @license GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 | ||
# @license For non GPL-v3 usage, commercial licenses must be purchased. Contact [email protected] | ||
|
||
Import('env') | ||
import os | ||
import shutil | ||
import gzip | ||
|
||
print("") | ||
print("***************************************************************************************************************************") | ||
print("********** STARMOD IS LICENSED UNDER GPL-V3. BY INSTALLING STARMOD YOU IMPLICITLY ACCEPT THE TERMS AND CONDITIONS ********") | ||
print("***************************************************************************************************************************") | ||
print("") | ||
|
||
isGitHub = "runner" in os.path.expanduser("~") #do not copy in github PlatformIO CI (/home/runner/ is output dir in github) | ||
|
||
if isGitHub: | ||
OUTPUT_DIR = "build_output{}".format(os.path.sep) | ||
else: | ||
OUTPUT_DIR = "{}{}Downloads{}".format(os.path.expanduser("~"), os.path.sep, os.path.sep) | ||
|
||
|
||
def _get_cpp_define_value(env, define): | ||
define_list = [item[-1] for item in env["CPPDEFINES"] if item[0] == define] | ||
if define_list: | ||
return define_list[0] | ||
return None | ||
|
||
def _create_dirs(dirs=["firmware", "map"]): | ||
# check if output directories exist and create if necessary | ||
if not os.path.isdir(OUTPUT_DIR): | ||
os.mkdir(OUTPUT_DIR) | ||
for d in dirs: | ||
if not os.path.isdir("{}{}".format(OUTPUT_DIR, d)): | ||
os.mkdir("{}{}".format(OUTPUT_DIR, d)) | ||
|
||
def bin_rename_copy(source, target, env): | ||
app = _get_cpp_define_value(env, "APP") | ||
version = _get_cpp_define_value(env, "VERSION") | ||
pioenv = env["PIOENV"] | ||
|
||
if isGitHub: | ||
_create_dirs(["release"]) | ||
# create string with location and file names based on pioenv | ||
bin_file = "{}release{}{}_{}_{}.bin".format(OUTPUT_DIR, os.path.sep, app, version, pioenv) | ||
else: | ||
bin_file = "{}{}_{}_{}.bin".format(OUTPUT_DIR, app, version, pioenv) | ||
|
||
# check if new target files exist and remove if necessary | ||
for f in [bin_file]: #map_file, | ||
if os.path.isfile(f): | ||
os.remove(f) | ||
|
||
# copy firmware.bin to bin_file | ||
shutil.copy(str(target[0]), bin_file) | ||
print(" created " + bin_file) | ||
|
||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_rename_copy]) |