mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-23 08:55:04 +00:00
Compare commits
3 Commits
0df6b78bd6
...
dddca1ea76
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dddca1ea76 | ||
|
|
c1ff024657 | ||
|
|
c7c9618f48 |
9
.github/workflows/build-firmware.yml
vendored
9
.github/workflows/build-firmware.yml
vendored
@ -15,6 +15,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
board: [
|
board: [
|
||||||
|
{ id: btt-panda-touch, arch: esp32s3 },
|
||||||
{ id: cyd-2432s024c, arch: esp32 },
|
{ id: cyd-2432s024c, arch: esp32 },
|
||||||
{ id: cyd-2432s028r, arch: esp32 },
|
{ id: cyd-2432s028r, arch: esp32 },
|
||||||
{ id: cyd-2432s028rv3, arch: esp32 },
|
{ id: cyd-2432s028rv3, arch: esp32 },
|
||||||
@ -44,11 +45,11 @@ jobs:
|
|||||||
{ id: m5stack-stickc-plus, arch: esp32 },
|
{ id: m5stack-stickc-plus, arch: esp32 },
|
||||||
{ id: m5stack-stickc-plus2, arch: esp32 },
|
{ id: m5stack-stickc-plus2, arch: esp32 },
|
||||||
{ id: unphone, arch: esp32s3 },
|
{ id: unphone, arch: esp32s3 },
|
||||||
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 },
|
{ id: waveshare-esp32-s3-geek, arch: esp32s3 },
|
||||||
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
|
|
||||||
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
|
|
||||||
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
|
{ id: waveshare-s3-lcd-13, arch: esp32s3 },
|
||||||
{ id: btt-panda-touch, arch: esp32s3 }
|
{ id: waveshare-s3-touch-lcd-128, arch: esp32s3 },
|
||||||
|
{ id: waveshare-s3-touch-lcd-147, arch: esp32s3 },
|
||||||
|
{ id: waveshare-s3-touch-lcd-43, arch: esp32s3 }
|
||||||
]
|
]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@ -1,13 +1,15 @@
|
|||||||
|
import subprocess
|
||||||
|
from datetime import datetime, UTC
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import configparser
|
import configparser
|
||||||
from dataclasses import dataclass, asdict
|
from dataclasses import dataclass, asdict
|
||||||
import json
|
import json
|
||||||
import shutil
|
import shutil
|
||||||
from configparser import ConfigParser, RawConfigParser
|
from configparser import RawConfigParser
|
||||||
|
|
||||||
VERBOSE = False
|
VERBOSE = False
|
||||||
DEVICES_FOLDER = "Boards"
|
DEVICES_FOLDER = "Devices"
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class IndexEntry:
|
class IndexEntry:
|
||||||
@ -39,6 +41,8 @@ class ManifestBuildPart:
|
|||||||
@dataclass
|
@dataclass
|
||||||
class DeviceIndex:
|
class DeviceIndex:
|
||||||
version: str
|
version: str
|
||||||
|
created: str
|
||||||
|
gitCommit: str
|
||||||
devices: list
|
devices: list
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
@ -174,6 +178,10 @@ def process_device(in_path: str, out_path: str, device_directory: str, device_id
|
|||||||
with open(json_manifest_path, 'w') as json_manifest_file:
|
with open(json_manifest_path, 'w') as json_manifest_file:
|
||||||
json.dump(asdict(manifest), json_manifest_file, indent=2)
|
json.dump(asdict(manifest), json_manifest_file, indent=2)
|
||||||
|
|
||||||
|
|
||||||
|
def get_git_commit_hash():
|
||||||
|
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
|
||||||
|
|
||||||
def main(in_path: str, out_path: str, version: str):
|
def main(in_path: str, out_path: str, version: str):
|
||||||
if not os.path.exists(in_path):
|
if not os.path.exists(in_path):
|
||||||
exit_with_error(f"Input path not found: {in_path}")
|
exit_with_error(f"Input path not found: {in_path}")
|
||||||
@ -181,7 +189,12 @@ def main(in_path: str, out_path: str, version: str):
|
|||||||
shutil.rmtree(out_path)
|
shutil.rmtree(out_path)
|
||||||
os.mkdir(out_path)
|
os.mkdir(out_path)
|
||||||
device_directories = os.listdir(in_path)
|
device_directories = os.listdir(in_path)
|
||||||
device_index = DeviceIndex(version, [])
|
device_index = DeviceIndex(
|
||||||
|
version=version,
|
||||||
|
created=datetime.now(UTC).strftime('%Y-%m-%dT%H:%M:%S'),
|
||||||
|
gitCommit=get_git_commit_hash(),
|
||||||
|
devices=[]
|
||||||
|
)
|
||||||
for device_directory in device_directories:
|
for device_directory in device_directories:
|
||||||
if device_directory.endswith("-symbols"):
|
if device_directory.endswith("-symbols"):
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -1,30 +0,0 @@
|
|||||||
if (NOT WIN32)
|
|
||||||
string(ASCII 27 Esc)
|
|
||||||
set(ColorReset "${Esc}[m")
|
|
||||||
set(Cyan "${Esc}[36m")
|
|
||||||
else ()
|
|
||||||
set(ColorReset "")
|
|
||||||
set(Cyan "")
|
|
||||||
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 select a device with 'python device.py device-id'")
|
|
||||||
endif ()
|
|
||||||
string(LENGTH ${sdkconfig_board_id} sdkconfig_board_id_length)
|
|
||||||
set(id_length 0)
|
|
||||||
math(EXPR id_length "${sdkconfig_board_id_length} - 21")
|
|
||||||
string(SUBSTRING ${sdkconfig_board_id} 20 ${id_length} board_id)
|
|
||||||
message("Board name: ${Cyan}${board_id}${ColorReset}")
|
|
||||||
set(TACTILITY_BOARD_PROJECT ${board_id})
|
|
||||||
message("Board path: ${Cyan}Boards/${TACTILITY_BOARD_PROJECT}${ColorReset}\n")
|
|
||||||
set_property(GLOBAL PROPERTY TACTILITY_BOARD_PROJECT ${TACTILITY_BOARD_PROJECT})
|
|
||||||
set_property(GLOBAL PROPERTY TACTILITY_BOARD_ID ${board_id})
|
|
||||||
endfunction()
|
|
||||||
32
Buildscripts/device.cmake
Normal file
32
Buildscripts/device.cmake
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
if (NOT WIN32)
|
||||||
|
string(ASCII 27 Esc)
|
||||||
|
set(ColorReset "${Esc}[m")
|
||||||
|
set(Cyan "${Esc}[36m")
|
||||||
|
else ()
|
||||||
|
set(ColorReset "")
|
||||||
|
set(Cyan "")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
function(INIT_TACTILITY_GLOBALS SDKCONFIG_FILE)
|
||||||
|
get_filename_component(SDKCONFIG_FILE_ABS ${SDKCONFIG_FILE} ABSOLUTE)
|
||||||
|
# Find the device 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_DEVICE_ID\=\"[a-z0-9_\-]*\")" sdkconfig_device_id "${sdkconfig_text}")
|
||||||
|
if (sdkconfig_device_id STREQUAL "CONFIG_TT_DEVICE_ID=\"\"" OR sdkconfig_device_id STREQUAL "")
|
||||||
|
message(FATAL_ERROR "CONFIG_TT_DEVICE_ID not found in sdkconfig:\nMake sure you select a device with 'python device.py device-id'")
|
||||||
|
endif ()
|
||||||
|
string(LENGTH ${sdkconfig_device_id} sdkconfig_device_id_length)
|
||||||
|
set(id_length 0)
|
||||||
|
# Total length minus chars of 'CONFIG_TT_DEVICE_ID=""'
|
||||||
|
math(EXPR id_length "${sdkconfig_device_id_length} - 22")
|
||||||
|
# Skip 'CONFIG_TT_DEVICE_ID="' then read the relevant (remaining) chars
|
||||||
|
string(SUBSTRING ${sdkconfig_device_id} 21 ${id_length} device_id)
|
||||||
|
message("Device identifier: ${Cyan}${device_id}${ColorReset}")
|
||||||
|
set(TACTILITY_DEVICE_PROJECT ${device_id})
|
||||||
|
message("Device project path: ${Cyan}Devices/${TACTILITY_DEVICE_PROJECT}${ColorReset}\n")
|
||||||
|
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT ${TACTILITY_DEVICE_PROJECT})
|
||||||
|
set_property(GLOBAL PROPERTY TACTILITY_DEVICE_ID ${device_id})
|
||||||
|
endfunction()
|
||||||
@ -24,15 +24,15 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}")
|
message("Using ESP-IDF ${Cyan}v$ENV{ESP_IDF_VERSION}${ColorReset}")
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
|
|
||||||
include("Buildscripts/board.cmake")
|
include("Buildscripts/device.cmake")
|
||||||
|
|
||||||
init_tactility_globals("sdkconfig")
|
init_tactility_globals("sdkconfig")
|
||||||
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
get_property(TACTILITY_DEVICE_PROJECT GLOBAL PROPERTY TACTILITY_DEVICE_PROJECT)
|
||||||
|
|
||||||
set(COMPONENTS Firmware)
|
set(COMPONENTS Firmware)
|
||||||
set(EXTRA_COMPONENT_DIRS
|
set(EXTRA_COMPONENT_DIRS
|
||||||
"Firmware"
|
"Firmware"
|
||||||
"Boards/${TACTILITY_BOARD_PROJECT}"
|
"Devices/${TACTILITY_DEVICE_PROJECT}"
|
||||||
"Drivers"
|
"Drivers"
|
||||||
"Tactility"
|
"Tactility"
|
||||||
"TactilityC"
|
"TactilityC"
|
||||||
@ -60,8 +60,8 @@ if (DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
|
|
||||||
else ()
|
else ()
|
||||||
message("Building for sim target")
|
message("Building for sim target")
|
||||||
add_compile_definitions(CONFIG_TT_BOARD_ID="simulator")
|
add_compile_definitions(CONFIG_TT_DEVICE_ID="simulator")
|
||||||
add_compile_definitions(CONFIG_TT_BOARD_NAME="Simulator")
|
add_compile_definitions(CONFIG_TT_DEVICE_NAME="Simulator")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
project(Tactility)
|
project(Tactility)
|
||||||
@ -70,12 +70,12 @@ project(Tactility)
|
|||||||
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
||||||
add_subdirectory(Tactility)
|
add_subdirectory(Tactility)
|
||||||
add_subdirectory(TactilityCore)
|
add_subdirectory(TactilityCore)
|
||||||
add_subdirectory(Boards/simulator)
|
add_subdirectory(Devices/simulator)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
||||||
# FreeRTOS
|
# FreeRTOS
|
||||||
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Boards/simulator/Source CACHE STRING "")
|
set(FREERTOS_CONFIG_FILE_DIRECTORY ${PROJECT_SOURCE_DIR}/Devices/simulator/Source CACHE STRING "")
|
||||||
set(FREERTOS_PORT GCC_POSIX CACHE STRING "")
|
set(FREERTOS_PORT GCC_POSIX CACHE STRING "")
|
||||||
|
|
||||||
add_subdirectory(Libraries/cJSON)
|
add_subdirectory(Libraries/cJSON)
|
||||||
@ -86,7 +86,7 @@ if (NOT DEFINED ENV{ESP_IDF_VERSION})
|
|||||||
add_subdirectory(Libraries/minmea)
|
add_subdirectory(Libraries/minmea)
|
||||||
target_compile_definitions(freertos_kernel PUBLIC "projCOVERAGE_TEST=0")
|
target_compile_definitions(freertos_kernel PUBLIC "projCOVERAGE_TEST=0")
|
||||||
target_include_directories(freertos_kernel
|
target_include_directories(freertos_kernel
|
||||||
PUBLIC Boards/simulator/Source # for FreeRTOSConfig.h
|
PUBLIC Devices/Simulator/Source # for FreeRTOSConfig.h
|
||||||
)
|
)
|
||||||
|
|
||||||
# EmbedTLS
|
# EmbedTLS
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user