Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '18'
exclude-regex: '(lib|Drivers|Core|net/include/sys|net/include/netinet|sframe|gsl)'
exclude-regex: '(lib|Drivers|Core|net/include/sys|net/include/netinet|cmox)'
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
[submodule "firmware/net/components/nlohmann_json/lib"]
path = firmware/net/components/nlohmann_json/lib
url = git@github.com:nlohmann/json.git
[submodule "firmware/ui/dependencies/sframe"]
path = firmware/ui/dependencies/sframe
url = https://github.com/GhostofCookie/sframe.git
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
Hardware design for test device

## Table of contents:
1. [Where To Find Things](#where)
2. [Hardware](#hardware)
3. [Firmware](#firmware)
1. [License](#License)
2. [Where To Find Things](#where)
3. [Hardware](#hardware)
4. [Firmware](#firmware)
1. [Management](#management)
2. [User Interface](#ui)
3. [Network](#network)
Expand All @@ -17,6 +18,9 @@ Hardware design for test device
2. [Python Serial Monitor](#serial_monitor)
5. [Hactar Setup](#hactar_setup)

## License

The license for information in this repository is in [LICENSE]. This license covers everything in the repository except for the directory `firmware/ui/dependencies/cmox`, which is covered by the license in [firmware/ui/dependencies/cmox/LICENSE].

<h2 id="where">Where To Find Things</h2>

Expand Down
15 changes: 1 addition & 14 deletions firmware/ui/.mxproject

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions firmware/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
cmake_minimum_required(VERSION 3.22)

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/gcc-arm-none-eabi.cmake")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

#
# This file is generated only once,
# and is not re-generated if converter is called multiple times.
#
# User is free to modify the file as much as necessary
#

# Setup compiler settings
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)

# Define the build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()

# Set the project name
set(CMAKE_PROJECT_NAME ui)

# Enable compile command to ease indexing with e.g. clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

# Find dependencies
set(STM32Cryptographic_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/cmox)
find_package(STM32Cryptographic COMPONENTS CM4 REQUIRED)
add_library(STM32Cryptographic ALIAS STM32Cryptographic::CM4)

set(CRYPTO "STM32" CACHE STRING "" FORCE)
set(NO_ALLOC ON CACHE BOOL "" FORCE)
add_compile_definitions(NO_ALLOC)
add_subdirectory(dependencies/sframe)

# Core project settings
project(${CMAKE_PROJECT_NAME} C CXX ASM)
message("Build type: " ${CMAKE_BUILD_TYPE})

# Enable CMake support for ASM and C languages
enable_language(C CXX ASM)

# Create an executable object type
add_executable(${CMAKE_PROJECT_NAME})

# Add STM32CubeMX generated sources
add_subdirectory(cmake/stm32cubemx)

# Link directories setup
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined library search paths
)

file(GLOB_RECURSE CXX_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc")
file(GLOB_RECURSE SHARED_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/../shared/*.cc")
message(STATUS ${CXX_SOURCES}
${SHARED_SOURCES})
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
${CXX_SOURCES}
${SHARED_SOURCES}
)

# Add include paths
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Core/Inc
${CMAKE_CURRENT_SOURCE_DIR}/inc
${CMAKE_CURRENT_SOURCE_DIR}/inc/fonts
${CMAKE_CURRENT_SOURCE_DIR}/../shared_inc
${CMAKE_CURRENT_SOURCE_DIR}/../shared/
)

# Add project symbols (macros)
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
)

# Add linked libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
stm32cubemx

sframe
)

add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O binary $<TARGET_FILE:${CMAKE_PROJECT_NAME}> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
COMMAND ${CMAKE_OBJCOPY} -O ihex $<TARGET_FILE:${CMAKE_PROJECT_NAME}> ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.hex
COMMENT "Generating .bin and .hex files"
)
60 changes: 60 additions & 0 deletions firmware/ui/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"version": 3,
"configurePresets": [
{
"name": "default",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake",
"cacheVariables": {
}
},
{
"name": "Debug",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "RelWithDebInfo",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "Release",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "MinSizeRel",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
}
],
"buildPresets": [
{
"name": "Debug",
"configurePreset": "Debug"
},
{
"name": "RelWithDebInfo",
"configurePreset": "RelWithDebInfo"
},
{
"name": "Release",
"configurePreset": "Release"
},
{
"name": "MinSizeRel",
"configurePreset": "MinSizeRel"
}
]
}
Loading