mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Merge branch '2.3' into 2.4
This commit is contained in:
commit
1e25fba4ba
7 changed files with 100 additions and 25 deletions
|
@ -1706,3 +1706,4 @@ Scott McCoy
|
|||
Fabrice Debonnet
|
||||
James Laver
|
||||
Kevin Bowens
|
||||
David Frech
|
||||
|
|
|
@ -1346,7 +1346,7 @@ void registerOpenTxFirmwares()
|
|||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* Radiomaster TX16S board */
|
||||
firmware = new OpenTxFirmware("opentx-tx16s", Firmware::tr("Radiomaster TX16S"), BOARD_RADIOMASTER_TX16S);
|
||||
firmware = new OpenTxFirmware("opentx-tx16s", Firmware::tr("Radiomaster TX16s / TX16s Hall / TX16s Masterfire"), BOARD_RADIOMASTER_TX16S);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
|
|
@ -362,6 +362,10 @@ if(JUMPER_RELEASE)
|
|||
add_definitions(-DJUMPER_RELEASE)
|
||||
endif()
|
||||
|
||||
if(RADIOMASTER_RELEASE)
|
||||
add_definitions(-DRADIOMASTER_RELEASE)
|
||||
endif()
|
||||
|
||||
if(TBS_RELEASE)
|
||||
add_definitions(-DTBS_RELEASE)
|
||||
endif()
|
||||
|
|
|
@ -186,7 +186,7 @@ static const char * const PXX2ReceiversNames[] = {
|
|||
"R9-SLIM+",
|
||||
"R9-MINI",
|
||||
"R9-MM",
|
||||
"R9-STAB",
|
||||
"R9-STAB", // R9-STAB has OTA
|
||||
"R9-MINI-OTA", // this one has OTA (different bootloader)
|
||||
"R9-MM-OTA", // this one has OTA (different bootloader)
|
||||
"R9-SLIM+-OTA", // this one has OTA (different bootloader)
|
||||
|
@ -236,7 +236,7 @@ static const uint8_t PXX2ReceiverOptions[] = {
|
|||
0b11111110, // R9-SLIM+
|
||||
0b11111110, // R9-MINI
|
||||
0b11111110, // R9-MM
|
||||
0b11111110, // R9-STAB
|
||||
0b11111111, // R9-STAB+OTA
|
||||
0b11111111, // R9-MINI+OTA
|
||||
0b11111111, // R9-MM+OTA
|
||||
0b11111111, // R9-SLIM+OTA
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#define DISPLAY_VERSION "FrSky"
|
||||
#elif defined(JUMPER_RELEASE)
|
||||
#define DISPLAY_VERSION "JumperRC"
|
||||
#elif defined(RADIOMASTER_RELEASE)
|
||||
#define DISPLAY_VERSION "Radiomaster"
|
||||
#elif defined(TBS_RELEASE)
|
||||
#define DISPLAY_VERSION "TBS"
|
||||
#else
|
||||
|
|
|
@ -5,7 +5,6 @@ import os
|
|||
import sys
|
||||
import subprocess
|
||||
import shutil
|
||||
import filelock
|
||||
|
||||
from fwoptions import *
|
||||
|
||||
|
@ -42,7 +41,7 @@ def build_target(target, path, cmake_options):
|
|||
return COMPILATION_ERROR
|
||||
|
||||
# Launch make
|
||||
cmd = ["make", "-j2", target]
|
||||
cmd = ["make", "-j3", target]
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
output, error = proc.communicate()
|
||||
if proc.returncode == 0:
|
||||
|
@ -56,7 +55,7 @@ def build_target(target, path, cmake_options):
|
|||
|
||||
def main():
|
||||
if len(sys.argv) != 3:
|
||||
exit(INVALID_FIRMWARE)
|
||||
return INVALID_FIRMWARE
|
||||
|
||||
target = sys.argv[1]
|
||||
directory, filename = os.path.split(sys.argv[2])
|
||||
|
@ -64,7 +63,7 @@ def main():
|
|||
options = root.split("-")
|
||||
|
||||
if len(options) < 2 or options[0] != "opentx":
|
||||
exit(INVALID_FIRMWARE)
|
||||
return INVALID_FIRMWARE
|
||||
|
||||
optcount = 1
|
||||
cmake_options = {}
|
||||
|
@ -155,7 +154,7 @@ def main():
|
|||
firmware_options = options_jumper_t16
|
||||
maxsize = 2 * 1024 * 1024
|
||||
else:
|
||||
exit(INVALID_BOARD)
|
||||
return INVALID_BOARD
|
||||
|
||||
if target == "firmware":
|
||||
binary = "firmware.bin"
|
||||
|
@ -166,7 +165,7 @@ def main():
|
|||
ext = ".so"
|
||||
filename = "libopentx"
|
||||
else:
|
||||
exit(INVALID_BOARD)
|
||||
return INVALID_BOARD
|
||||
|
||||
filename += "-" + board_name
|
||||
optcount += 1
|
||||
|
@ -198,7 +197,7 @@ def main():
|
|||
if key == options[-1]:
|
||||
language = key
|
||||
if not language:
|
||||
exit(INVALID_LANGUAGE)
|
||||
return INVALID_LANGUAGE
|
||||
cmake_options["TRANSLATIONS"] = language.upper()
|
||||
|
||||
filename += "-" + language + ext
|
||||
|
@ -207,24 +206,16 @@ def main():
|
|||
|
||||
if os.path.isfile(errpath):
|
||||
print(filename)
|
||||
exit(COMPILATION_ERROR)
|
||||
return COMPILATION_ERROR
|
||||
|
||||
if os.path.isfile(path):
|
||||
print(filename)
|
||||
exit(0)
|
||||
return 0
|
||||
|
||||
lockpath = path + ".lock"
|
||||
lock = filelock.FileLock(lockpath)
|
||||
try:
|
||||
with lock.acquire(timeout=60 * 60):
|
||||
if not os.path.isfile(path):
|
||||
result = build_target(target, path, cmake_options)
|
||||
if result != 0:
|
||||
print(filename)
|
||||
return result
|
||||
except filelock.Timeout:
|
||||
result = build_target(target, path, cmake_options)
|
||||
if result != 0:
|
||||
print(filename)
|
||||
exit(COMPILATION_ERROR)
|
||||
return result
|
||||
|
||||
if target == "firmware":
|
||||
# Check binary size
|
||||
|
@ -236,8 +227,8 @@ def main():
|
|||
shutil.move(binary, path)
|
||||
|
||||
print(filename)
|
||||
exit(0)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
exit(main())
|
||||
|
|
77
tools/build-radiomaster.py
Executable file
77
tools/build-radiomaster.py
Executable file
|
@ -0,0 +1,77 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import os
|
||||
from builtins import NotADirectoryError
|
||||
import shutil
|
||||
import tempfile
|
||||
|
||||
|
||||
boards = {
|
||||
"TX16S_1": {
|
||||
"PCB": "X10",
|
||||
"PCBREV": "TX16S",
|
||||
"DEFAULT_MODE": "1",
|
||||
},
|
||||
"TX16S_2": {
|
||||
"PCB": "X10",
|
||||
"PCBREV": "TX16S",
|
||||
"DEFAULT_MODE": "2",
|
||||
}
|
||||
}
|
||||
|
||||
translations = [
|
||||
"EN",
|
||||
]
|
||||
|
||||
|
||||
def timestamp():
|
||||
return datetime.datetime.now().strftime("%y%m%d")
|
||||
|
||||
|
||||
def build(board, translation, srcdir):
|
||||
cmake_options = " ".join(["-D%s=%s" % (key, value) for key, value in boards[board].items()])
|
||||
cwd = os.getcwd()
|
||||
if not os.path.exists("output"):
|
||||
os.mkdir("output")
|
||||
path = tempfile.mkdtemp()
|
||||
os.chdir(path)
|
||||
command = "cmake %s -DTRANSLATIONS=%s -DRADIOMASTER_RELEASE=YES %s" % (cmake_options, translation, srcdir)
|
||||
print(command)
|
||||
os.system(command)
|
||||
os.system("make firmware -j6")
|
||||
os.chdir(cwd)
|
||||
index = 0
|
||||
while 1:
|
||||
suffix = "" if index == 0 else "_%d" % index
|
||||
filename = "output/firmware_%s_%s_%s%s.bin" % (board.lower(), translation.lower(), timestamp(), suffix)
|
||||
if not os.path.exists(filename):
|
||||
shutil.copy("%s/firmware.bin" % path, filename)
|
||||
break
|
||||
index += 1
|
||||
shutil.rmtree(path)
|
||||
|
||||
|
||||
def dir_path(string):
|
||||
if os.path.isdir(string):
|
||||
return string
|
||||
else:
|
||||
raise NotADirectoryError(string)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Build Radiomaster firmware")
|
||||
parser.add_argument("-b", "--boards", action="append", help="Destination boards", required=True)
|
||||
parser.add_argument("-t", "--translations", action="append", help="Translations", required=True)
|
||||
parser.add_argument("srcdir", type=dir_path)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
for board in (boards.keys() if "ALL" in args.boards else args.boards):
|
||||
for translation in (translations if "ALL" in args.translations else args.translations):
|
||||
build(board, translation, args.srcdir)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue