Skip to content

Commit 0d4c1e8

Browse files
Merge branch 'main' into feature/YF-cover-ui
2 parents b64bea7 + 187b26c commit 0d4c1e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+7357
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@ jobs:
4242
mkdir artifacts
4343
cp ./out/openmower-yardforce.bin ./artifacts
4444
cp ./out/openmower-yardforce.elf ./artifacts
45+
cp ./out/openmower-yardforce-v4.bin ./artifacts
46+
cp ./out/openmower-yardforce-v4.elf ./artifacts
4547
cp ./out/openmower-worx.bin ./artifacts
4648
cp ./out/openmower-worx.elf ./artifacts
4749
cp ./out/openmower-lyfco-e1600.bin ./artifacts
4850
cp ./out/openmower-lyfco-e1600.elf ./artifacts
4951
cp ./out/openmower-sabo.bin ./artifacts
5052
cp ./out/openmower-sabo.elf ./artifacts
53+
cp ./out/ram-info.html ./artifacts
54+
cp ./out/flash-info.html ./artifacts
5155
- name: Upload Artifacts
5256
uses: actions/upload-artifact@v4
5357
with:
@@ -64,9 +68,9 @@ jobs:
6468
name: openmower
6569
path: artifacts
6670
- name: Compress release directory into a versioned ZIP file
67-
run: zip -r "xcore-boot-${{ github.ref_name }}.zip" artifacts/*
71+
run: cd artifacts && zip -r "../fw-openmower-v2-${{ github.ref_name }}.zip" .
6872
- uses: "marvinpinto/action-automatic-releases@latest"
6973
with:
7074
repo_token: "${{ secrets.GITHUB_TOKEN }}"
7175
prerelease: false
72-
files: "xcore-boot-${{ github.ref_name }}.zip"
76+
files: "fw-openmower-v2-${{ github.ref_name }}.zip"

CMakeLists.txt

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
3636

3737
target_compile_options(${CMAKE_PROJECT_NAME} PUBLIC -Wall -Wextra -Werror)
3838

39-
4039
# Add lib subdirectory
4140
add_subdirectory(ext)
4241
target_compile_definitions(ulog PUBLIC ULOG_ENABLED)
@@ -47,6 +46,12 @@ target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
4746
# Add user defined library search paths
4847
)
4948

49+
# Add LVGL assets
50+
file(GLOB LVGL_ASSETS_SRC
51+
"src/drivers/ui/lvgl/assets/*.c"
52+
"src/drivers/ui/lvgl/assets/Orbitron/*.c"
53+
)
54+
5055
# Add sources to executable
5156
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
5257
boards/XCORE/board_utils.cpp
@@ -77,6 +82,8 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
7782
src/drivers/motor/vesc/buffer.cpp
7883
src/drivers/motor/vesc/crc.cpp
7984
src/drivers/motor/vesc/VescDriver.cpp
85+
# YFR4-ESC driver
86+
src/drivers/motor/yfr4esc/YFR4escDriver.cpp
8087
# PWM motor driver
8188
src/drivers/motor/pwm/pwm_motor_driver.cpp
8289
# GPS driver
@@ -92,12 +99,17 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
9299
$<$<CONFIG:Debug>:src/drivers/input/simulated_input_driver.cpp>
93100
# YardForce Cover UI Driver
94101
src/drivers/ui/YardForceCoverUI/yardforce_cover_ui_driver.cpp
102+
# Sabo driver
103+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_cabo_driver_base.cpp
104+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_controller.cpp
105+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_display_driver_uc1698.cpp
95106
# Raw driver debug interface
96107
src/debug/debug_tcp_interface.cpp
97108
src/debug/debug_udp_interface.cpp
98109
src/debug/debuggable_driver.cpp
99110
robots/src/robot.cpp
100111
${PLATFORM_SOURCES}
112+
${LVGL_ASSETS_SRC}
101113
)
102114

103115
# Add include paths
@@ -124,6 +136,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
124136
etl::etl
125137
LittleFS
126138
lwjson
139+
lvgl
127140
)
128141

129142
target_add_service(${CMAKE_PROJECT_NAME} ImuService ${CMAKE_CURRENT_SOURCE_DIR}/services/imu_service.json)
@@ -149,3 +162,16 @@ add_custom_target(upload
149162
COMMAND docker run --rm --network=host -v ${CMAKE_BINARY_DIR}:/workdir ghcr.io/xtech/fw-xcore-boot:latest -i tap0 upload /workdir/${CMAKE_PROJECT_NAME}.bin
150163
DEPENDS ${CMAKE_PROJECT_NAME}
151164
)
165+
166+
# Check if elf-size-analyze is available
167+
find_program(ELF_SIZE_ANALYZE_EXECUTABLE elf-size-analyze)
168+
169+
if(ELF_SIZE_ANALYZE_EXECUTABLE)
170+
add_custom_command(
171+
TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
172+
COMMAND ${ELF_SIZE_ANALYZE_EXECUTABLE} -R -t arm-none-eabi- ${CMAKE_PROJECT_NAME}.elf
173+
COMMENT "Running elf-size-analyze on target binary..."
174+
)
175+
else()
176+
message(WARNING "elf-size-analyze not found! Skipping size analysis.")
177+
endif()

Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,40 @@ RUN apt-get update && apt-get install -y \
99
make \
1010
&& rm -rf /var/lib/apt/lists/*
1111

12+
# Install ccache (TODO: REMOVE as soon as we have universal firmware)
13+
RUN apt-get update && apt-get install -y ccache \
14+
&& rm -rf /var/lib/apt/lists/* \
15+
&& /usr/sbin/update-ccache-symlinks
16+
ENV PATH="/usr/lib/ccache:$PATH"
17+
18+
RUN pip install elf-size-analyze
19+
1220
COPY . /project
1321

1422
WORKDIR /project
1523
RUN mkdir build
1624
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=YardForce -BYardForce && cd YardForce && make -j$(nproc)
25+
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=YardForce_V4 -BYardForce_V4 && cd YardForce_V4 && make -j$(nproc)
1726
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Worx -BWorx && cd Worx && make -j$(nproc)
1827
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Lyfco_E1600 -BLyfco_E1600 && cd Lyfco_E1600 && make -j$(nproc)
1928
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=Sabo -BSabo && cd Sabo && make -j$(nproc)
2029
RUN cd build && cmake .. --preset=Release -DROBOT_PLATFORM=xBot -BxBot && cd xBot && make -j$(nproc)
21-
30+
# Use Sabo build for RAM and ROM analysis for now - it has the most libraries
31+
RUN elf-size-analyze -H -R -t arm-none-eabi- ./build/Sabo/openmower.elf -W > build/ram-info.html
32+
RUN elf-size-analyze -H -F -t arm-none-eabi- ./build/Sabo/openmower.elf -W > build/flash-info.html
33+
RUN ccache -s > build/ccache.txt
2234

2335
FROM scratch
36+
COPY --from=builder /project/build/ccache.txt /ccache.txt
37+
COPY --from=builder /project/build/ram-info.html /ram-info.html
38+
COPY --from=builder /project/build/flash-info.html /flash-info.html
39+
2440
COPY --from=builder /project/build/YardForce/openmower.bin /openmower-yardforce.bin
2541
COPY --from=builder /project/build/YardForce/openmower.elf /openmower-yardforce.elf
2642

43+
COPY --from=builder /project/build/YardForce_V4/openmower.bin /openmower-yardforce-v4.bin
44+
COPY --from=builder /project/build/YardForce_V4/openmower.elf /openmower-yardforce-v4.elf
45+
2746
COPY --from=builder /project/build/Worx/openmower.bin /openmower-worx.bin
2847
COPY --from=builder /project/build/Worx/openmower.elf /openmower-worx.elf
2948

ext/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ target_compile_definitions(xbot-service PUBLIC XBOT_ENABLE_STATIC_STACK)
1010
add_subdirectory(LSM6DS3TR-C-PID)
1111
add_subdirectory(etl)
1212

13+
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
14+
set(CONFIG_LV_BUILD_EXAMPLES OFF)
15+
set(CONFIG_LV_BUILD_DEMOS OFF)
16+
set(CONFIG_LV_USE_THORVG_INTERNAL OFF)
17+
add_subdirectory(lvgl)
1318

1419
# Add LittleFS
1520
add_library(LittleFS littlefs/lfs.c littlefs/lfs_util.c)

ext/ChibiOS_21.11.3/os/hal/ports/STM32/LLD/USARTv3/hal_uart_lld.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,10 @@ void uart_lld_serve_interrupt(UARTDriver *uartp) {
12171217
isr = u->ISR;
12181218
u->ICR = isr;
12191219

1220+
if (isr & USART_ISR_CMF) {
1221+
_uart_rx_char_match_isr_code(uartp);
1222+
}
1223+
12201224
if (isr & (USART_ISR_LBDF | USART_ISR_ORE | USART_ISR_NE |
12211225
USART_ISR_FE | USART_ISR_PE)) {
12221226
_uart_rx_error_isr_code(uartp, translate_errors(isr));

ext/ChibiOS_21.11.3/os/hal/ports/STM32/LLD/USARTv3/hal_uart_lld.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ typedef struct hal_uart_config {
894894
* flags in CR registers and supported hardware features.
895895
*/
896896
uartcb_t timeout_cb;
897+
/**
898+
* @brief Character Received callback.
899+
*/
900+
uartcb_t rx_cm_cb;
897901
/**
898902
* @brief Receiver timeout value in terms of number of bit duration.
899903
* @details Set it to 0 when you want to handle idle interrupt instead of

ext/lvgl/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Include(FetchContent)
2+
3+
FetchContent_Declare(
4+
lvgl
5+
GIT_REPOSITORY https://github.com/lvgl/lvgl
6+
GIT_TAG v9.3.0
7+
)
8+
9+
FetchContent_MakeAvailable(lvgl)

0 commit comments

Comments
 (0)