Replace sdkconfig with device.properties (#411)
This commit is contained in:
committed by
GitHub
parent
8335611796
commit
7918451699
@@ -1,175 +0,0 @@
|
||||
[btt-panda-touch]
|
||||
vendor=BigTreeTech
|
||||
boardName=Panda Touch,K Touch
|
||||
incubating=false
|
||||
|
||||
[cyd-2432s024c]
|
||||
vendor=CYD
|
||||
boardName=2432S024C
|
||||
incubating=false
|
||||
warningMessage=There currently is a known issue with the display driver.<br/>It will likely show artifacts.
|
||||
|
||||
[cyd-2432s028r]
|
||||
vendor=CYD
|
||||
boardName=2432S028R
|
||||
incubating=false
|
||||
warningMessage=There are 3 hardware variants of this board. This build works on the original variant only ("v1").
|
||||
|
||||
[cyd-2432s028rv3]
|
||||
vendor=CYD
|
||||
boardName=2432S028R v3
|
||||
incubating=false
|
||||
warningMessage=There are 3 hardware variants of this board. This build only supports board version 3.
|
||||
|
||||
[cyd-2432s032c]
|
||||
vendor=CYD
|
||||
boardName=2432S032C
|
||||
incubating=false
|
||||
|
||||
[cyd-4848s040c]
|
||||
vendor=CYD
|
||||
boardName=4848S040C
|
||||
incubating=false
|
||||
|
||||
[cyd-8048s043c]
|
||||
vendor=CYD
|
||||
boardName=8048S043C
|
||||
incubating=false
|
||||
|
||||
[cyd-e32r28t]
|
||||
vendor=CYD
|
||||
boardName=E32R28T
|
||||
incubating=false
|
||||
|
||||
[cyd-e32r32p]
|
||||
vendor=CYD
|
||||
boardName=E32R32P
|
||||
incubating=false
|
||||
|
||||
[cyd-jc2432w328c]
|
||||
vendor=CYD
|
||||
boardName=JC2432W328C
|
||||
incubating=false
|
||||
|
||||
[cyd-jc8048w550c]
|
||||
vendor=CYD
|
||||
boardName=JC8048W550C
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-advance-28]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Advance 2.8"
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-advance-35]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Advance 3.5"
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-advance-50]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Advance 5"
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-basic-28]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Basic 2.8"
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-basic-35]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Basic 3.5"
|
||||
incubating=false
|
||||
|
||||
[elecrow-crowpanel-basic-50]
|
||||
vendor=Elecrow
|
||||
boardName=CrowPanel Basic 5"
|
||||
incubating=false
|
||||
|
||||
[heltec-wifi-lora-32-v3]
|
||||
vendor=Heltec
|
||||
boardName=v3
|
||||
incubating=true
|
||||
infoMessage=Due to the small size of the screen, the icons don't render properly.
|
||||
|
||||
[lilygo-tdeck]
|
||||
vendor=LilyGO
|
||||
boardName=T-Deck,T-Deck Plus
|
||||
incubating=false
|
||||
infoMessage=If two serial devices are visible, try them both.<br/><br/>To put the device into bootloader mode: <br/>1. Press the trackball and then the reset button at the same time,<br/>2. Let go of the reset button, then the trackball.<br/><br/>When this website reports that flashing is finished, you likely have to press the reset button.
|
||||
|
||||
[lilygo-tdisplay]
|
||||
vendor=LilyGO
|
||||
boardName=T-Display
|
||||
incubating=true
|
||||
|
||||
[lilygo-tdisplay-s3]
|
||||
vendor=LilyGO
|
||||
boardName=T-Display S3
|
||||
incubating=false
|
||||
|
||||
[lilygo-tdongle-s3]
|
||||
vendor=LilyGO
|
||||
boardName=T-Dongle S3
|
||||
incubating=true
|
||||
|
||||
[lilygo-tlora-pager]
|
||||
vendor=LilyGO
|
||||
boardName=T-Lora Pager
|
||||
incubating=false
|
||||
|
||||
[m5stack-cardputer]
|
||||
vendor=M5Stack
|
||||
boardName=Cardputer,Cardputer v1.1
|
||||
incubating=false
|
||||
|
||||
[m5stack-cardputer-adv]
|
||||
vendor=M5Stack
|
||||
boardName=Cardputer Adv
|
||||
incubating=false
|
||||
|
||||
[m5stack-core2]
|
||||
vendor=M5Stack
|
||||
boardName=Core2
|
||||
incubating=false
|
||||
|
||||
[m5stack-cores3]
|
||||
vendor=M5Stack
|
||||
boardName=CoreS3
|
||||
incubating=false
|
||||
|
||||
[m5stack-stickc-plus]
|
||||
vendor=M5Stack
|
||||
boardName=StickC Plus
|
||||
incubating=true
|
||||
|
||||
[m5stack-stickc-plus2]
|
||||
vendor=M5Stack
|
||||
boardName=StickC Plus2
|
||||
incubating=true
|
||||
|
||||
[unphone]
|
||||
vendor=unPhone
|
||||
boardName=unPhone
|
||||
incubating=false
|
||||
warningMessage=There is a power drain issue that slowly depletes the device when it\'s off. It lasts about 3 days.<br/>Completely depleting a battery can permanently decrease capacity. ?<br/><br/>This is a newly implemented device, so there might be other issues. Use at your own risk.<br/><br/>Put the device into bootloader mode by pressing the center nav button and reset for 2-3 seconds, then release reset, then release the nav button.<br/>After flashing is finished, press the reset button to reboot.
|
||||
|
||||
[waveshare-s3-lcd-13]
|
||||
vendor=WaveShare
|
||||
boardName=S3 LCD 1.3"
|
||||
incubating=true
|
||||
|
||||
[waveshare-s3-touch-lcd-43]
|
||||
vendor=WaveShare
|
||||
boardName=S3 Touch LCD 4.3"
|
||||
incubating=false
|
||||
|
||||
[waveshare-s3-touch-lcd-128]
|
||||
vendor=WaveShare
|
||||
boardName=S3 Touch LCD 1.28"
|
||||
incubating=true
|
||||
|
||||
[waveshare-s3-touch-lcd-147]
|
||||
vendor=WaveShare
|
||||
boardName=S3 Touch LCD 1.47"
|
||||
incubating=true
|
||||
@@ -5,7 +5,8 @@ from dataclasses import dataclass, asdict
|
||||
import json
|
||||
import shutil
|
||||
|
||||
verbose = False
|
||||
VERBOSE = False
|
||||
DEVICES_FOLDER = "Boards"
|
||||
|
||||
@dataclass
|
||||
class IndexEntry:
|
||||
@@ -71,8 +72,8 @@ def read_properties_file(path):
|
||||
config.read(path)
|
||||
return config
|
||||
|
||||
def read_mapping_file():
|
||||
mapping_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "devices.properties")
|
||||
def read_device_properties(device_id):
|
||||
mapping_file_path = os.path.join(DEVICES_FOLDER, device_id, "device.properties")
|
||||
if not os.path.isfile(mapping_file_path):
|
||||
exit_with_error(f"Mapping file not found: {mapping_file_path}")
|
||||
return read_properties_file(mapping_file_path)
|
||||
@@ -84,12 +85,20 @@ def to_manifest_chip_name(name):
|
||||
return "ESP32-S2"
|
||||
elif name == "esp32s3":
|
||||
return "ESP32-S3"
|
||||
elif name == "esp32c2":
|
||||
return "ESP32-C2"
|
||||
elif name == "esp32c3":
|
||||
return "ESP32-C3"
|
||||
elif name == "esp32c5":
|
||||
return "ESP32-C5"
|
||||
elif name == "esp32c6":
|
||||
return "ESP32-C6"
|
||||
elif name == "esp32c61":
|
||||
return "ESP32-C61"
|
||||
elif name == "esp32h2":
|
||||
return "ESP32-H2"
|
||||
elif name == "esp32h4":
|
||||
return "ESP32-H4"
|
||||
elif name == "esp32p4":
|
||||
return "ESP32-P4"
|
||||
else:
|
||||
@@ -97,7 +106,7 @@ def to_manifest_chip_name(name):
|
||||
return ""
|
||||
|
||||
|
||||
def process_board(in_path: str, out_path: str, device_directory: str, device_id: str, device_mapping: configparser, version: str):
|
||||
def process_device(in_path: str, out_path: str, device_directory: str, device_id: str, device_properties: configparser, version: str):
|
||||
in_device_path = os.path.join(in_path, device_directory)
|
||||
in_device_binaries_path = os.path.join(in_device_path, "Binaries")
|
||||
assert os.path.isdir(in_device_binaries_path)
|
||||
@@ -108,7 +117,7 @@ def process_board(in_path: str, out_path: str, device_directory: str, device_id:
|
||||
json_data.close()
|
||||
flash_files = flasher_args["flash_files"]
|
||||
manifest = Manifest(
|
||||
name=f"Tactility for {device_mapping["vendor"]} {device_mapping["boardName"]}",
|
||||
name=f"Tactility for {device_properties["general"]["vendor"]} {device_properties["general"]["name"]}",
|
||||
version=version,
|
||||
new_install_prompt_erase="true",
|
||||
funding_url="https://github.com/sponsors/ByteWelder",
|
||||
@@ -125,7 +134,7 @@ def process_board(in_path: str, out_path: str, device_directory: str, device_id:
|
||||
in_flash_file_path = os.path.join(in_device_binaries_path, flash_file_entry)
|
||||
out_flash_file_name = f"{device_id}-{flash_file_entry_name}"
|
||||
out_flash_file_path = os.path.join(out_path, out_flash_file_name)
|
||||
if verbose:
|
||||
if VERBOSE:
|
||||
print(f"Copying {in_flash_file_path} -> {out_flash_file_path}")
|
||||
shutil.copy(in_flash_file_path, out_flash_file_path)
|
||||
manifest.builds[0].parts.append(
|
||||
@@ -146,34 +155,34 @@ def main(in_path: str, out_path: str, version: str):
|
||||
if os.path.exists(out_path):
|
||||
shutil.rmtree(out_path)
|
||||
os.mkdir(out_path)
|
||||
mapping = read_mapping_file()
|
||||
device_directories = os.listdir(in_path)
|
||||
device_index = DeviceIndex(version, [])
|
||||
for device_directory in device_directories:
|
||||
if not device_directory.endswith("-symbols"):
|
||||
device_id = device_directory[10:]
|
||||
if device_id not in mapping.sections():
|
||||
exit_with_error(f"Mapping for {device_id} not found in mapping file")
|
||||
device_properties = mapping[device_id]
|
||||
process_board(in_path, out_path, device_directory, device_id, device_properties, version)
|
||||
if "warningMessage" in device_properties.keys():
|
||||
warning_message = device_properties["warningMessage"]
|
||||
else:
|
||||
warning_message = None
|
||||
if "infoMessage" in device_properties.keys():
|
||||
info_message = device_properties["infoMessage"]
|
||||
else:
|
||||
info_message = None
|
||||
if "incubating" in device_properties.keys():
|
||||
incubating = device_properties["incubating"].lower() == 'true'
|
||||
device_properties = read_device_properties(device_id)
|
||||
device_properties_general = device_properties["general"]
|
||||
process_device(in_path, out_path, device_directory, device_id, device_properties, version)
|
||||
if device_properties.has_section("cdn"):
|
||||
device_properties_cdn = device_properties["cdn"]
|
||||
if "warningMessage" in device_properties_cdn.keys():
|
||||
warning_message = device_properties_cdn["warningMessage"]
|
||||
else:
|
||||
warning_message = None
|
||||
if "infoMessage" in device_properties_cdn.keys():
|
||||
info_message = device_properties_cdn["infoMessage"]
|
||||
else:
|
||||
info_message = None
|
||||
if "incubating" in device_properties_general.keys():
|
||||
incubating = device_properties_general["incubating"].lower() == 'true'
|
||||
else:
|
||||
incubating = False
|
||||
board_names = device_properties["boardName"].split(',')
|
||||
for board_name in board_names:
|
||||
device_names = device_properties_general["name"].split(',')
|
||||
for device_name in device_names:
|
||||
device_index.devices.append(asdict(IndexEntry(
|
||||
id=device_id,
|
||||
name=board_name,
|
||||
vendor=device_properties["vendor"],
|
||||
name=device_name,
|
||||
vendor=device_properties_general["vendor"],
|
||||
incubating=incubating,
|
||||
warningMessage=warning_message,
|
||||
infoMessage=info_message
|
||||
@@ -193,6 +202,6 @@ if __name__ == "__main__":
|
||||
print_help()
|
||||
sys.exit()
|
||||
if "--verbose" in sys.argv:
|
||||
verbose = True
|
||||
VERBOSE = True
|
||||
sys.argv.remove("--verbose")
|
||||
main(in_path=sys.argv[1], out_path=sys.argv[2], version=sys.argv[3])
|
||||
@@ -2,28 +2,25 @@ import os
|
||||
import sys
|
||||
import boto3
|
||||
|
||||
verbose = False
|
||||
|
||||
if sys.platform == "win32":
|
||||
shell_color_red = ""
|
||||
shell_color_orange = ""
|
||||
shell_color_reset = ""
|
||||
SHELL_COLOR_RED = ""
|
||||
SHELL_COLOR_ORANGE = ""
|
||||
SHELL_COLOR_RESET = ""
|
||||
else:
|
||||
shell_color_red = "\033[91m"
|
||||
shell_color_orange = "\033[93m"
|
||||
shell_color_reset = "\033[m"
|
||||
SHELL_COLOR_RED = "\033[91m"
|
||||
SHELL_COLOR_ORANGE = "\033[93m"
|
||||
SHELL_COLOR_RESET = "\033[m"
|
||||
|
||||
def print_warning(message):
|
||||
print(f"{shell_color_orange}WARNING: {message}{shell_color_reset}")
|
||||
print(f"{SHELL_COLOR_ORANGE}WARNING: {message}{SHELL_COLOR_RESET}")
|
||||
|
||||
def print_error(message):
|
||||
print(f"{shell_color_red}ERROR: {message}{shell_color_reset}")
|
||||
print(f"{SHELL_COLOR_RED}ERROR: {message}{SHELL_COLOR_RESET}")
|
||||
|
||||
def print_help():
|
||||
print("Usage: python upload-files.py [path] [version] [cloudflareAccountId] [cloudflareTokenName] [cloudflareTokenValue]")
|
||||
print("")
|
||||
print("Options:")
|
||||
print(" --verbose Show extra console output")
|
||||
print(" --index-only Upload only index.json")
|
||||
|
||||
def exit_with_error(message):
|
||||
@@ -63,9 +60,6 @@ if __name__ == "__main__":
|
||||
if len(sys.argv) < 6:
|
||||
print_help()
|
||||
sys.exit()
|
||||
if "--verbose" in sys.argv:
|
||||
verbose = True
|
||||
sys.argv.remove("--verbose")
|
||||
main(
|
||||
path=sys.argv[1],
|
||||
version=sys.argv[2],
|
||||
|
||||
@@ -10,10 +10,13 @@ endif ()
|
||||
function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
|
||||
get_filename_component(SDKCONFIG_FILE_ABS ${SDKCONFIG_FILE} ABSOLUTE)
|
||||
# Find the board identifier in the sdkconfig file
|
||||
if (NOT EXISTS ${SDKCONFIG_FILE_ABS})
|
||||
message(FATAL_ERROR "sdkconfig file not found:\nMake sure you select a device by running \"python device.py [device-id]\"\n")
|
||||
endif ()
|
||||
file(READ ${SDKCONFIG_FILE_ABS} sdkconfig_text)
|
||||
string(REGEX MATCH "(CONFIG_TT_BOARD_ID\=\"[a-z0-9_\-]*\")" sdkconfig_board_id "${sdkconfig_text}")
|
||||
if (sdkconfig_board_id STREQUAL "")
|
||||
message(FATAL_ERROR "CONFIG_TT_BOARD_ID not found in sdkconfig:\nMake sure you copied one of the sdkconfig.board.* files into sdkconfig")
|
||||
message(FATAL_ERROR "CONFIG_TT_BOARD_ID not found in sdkconfig:\nMake sure you select a device with 'python device.py device-id'")
|
||||
endif ()
|
||||
string(LENGTH ${sdkconfig_board_id} sdkconfig_board_id_length)
|
||||
set(id_length 0)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Increase stack size for Wi-Fi (fixes crash after scan)
|
||||
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=3072
|
||||
# Ensure large enough stack for network operations
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=6144
|
||||
CONFIG_LV_FONT_MONTSERRAT_14=y
|
||||
CONFIG_LV_FONT_MONTSERRAT_18=y
|
||||
CONFIG_LV_USE_USER_DATA=y
|
||||
CONFIG_LV_USE_FS_STDIO=y
|
||||
CONFIG_LV_FS_STDIO_LETTER=65
|
||||
CONFIG_LV_FS_STDIO_PATH=""
|
||||
CONFIG_LV_FS_STDIO_CACHE_SIZE=4096
|
||||
CONFIG_LV_USE_LODEPNG=y
|
||||
CONFIG_LV_USE_BUILTIN_MALLOC=n
|
||||
CONFIG_LV_USE_CLIB_MALLOC=y
|
||||
CONFIG_LV_USE_MSGBOX=n
|
||||
CONFIG_LV_USE_SPINNER=n
|
||||
CONFIG_LV_USE_WIN=n
|
||||
CONFIG_LV_USE_SNAPSHOT=y
|
||||
CONFIG_FREERTOS_HZ=1000
|
||||
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
|
||||
CONFIG_FREERTOS_SMP=n
|
||||
CONFIG_FREERTOS_UNICORE=n
|
||||
CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=5120
|
||||
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
|
||||
CONFIG_FATFS_LFN_HEAP=y
|
||||
CONFIG_FATFS_VOLUME_COUNT=3
|
||||
CONFIG_FATFS_SECTOR_512=y
|
||||
CONFIG_WL_SECTOR_SIZE_512=y
|
||||
CONFIG_WL_SECTOR_SIZE=512
|
||||
CONFIG_WL_SECTOR_MODE_SAFE=y
|
||||
CONFIG_WL_SECTOR_MODE=1
|
||||
CONFIG_MBEDTLS_SSL_PROTO_TLS1_3=y
|
||||
# Fixes static assertion: FLASH and PSRAM Mode configuration are not supported
|
||||
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
|
||||
Reference in New Issue
Block a user