Skip to content

Commit b598a43

Browse files
committed
Revert LVGL and HighLevelService
1 parent a88da9a commit b598a43

File tree

10 files changed

+43
-209
lines changed

10 files changed

+43
-209
lines changed

CMakeLists.txt

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
3636

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

39-
# Set robot specific lv_conf.h before LVGL get build
40-
if(ROBOT_PLATFORM STREQUAL "Sabo")
41-
set(LV_BUILD_CONF_PATH "${CMAKE_SOURCE_DIR}/src/drivers/ui/SaboCoverUI/lv_conf.h" CACHE PATH "LVGL config" FORCE)
42-
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE LV_CONF_INCLUDE_SIMPLE)
43-
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE src/drivers/ui/SaboCoverUI)
44-
endif()
45-
4639
# Add lib subdirectory
4740
add_subdirectory(ext)
4841
target_compile_definitions(ulog PUBLIC ULOG_ENABLED)
@@ -74,7 +67,6 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
7467
src/services/mower_service/mower_service.cpp
7568
src/services/gps_service/gps_service.cpp
7669
src/services/input_service/input_service.cpp
77-
src/services/high_level_service/high_level_service.cpp
7870
# BQ2567 driver
7971
src/drivers/charger/bq_2576/bq_2576.cpp
8072
# BQ25679 driver
@@ -95,6 +87,10 @@ target_sources(${CMAKE_PROJECT_NAME} PRIVATE
9587
src/drivers/input/gpio_input_driver.cpp
9688
src/drivers/input/worx_input_driver.cpp
9789
$<$<CONFIG:Debug>:src/drivers/input/simulated_input_driver.cpp>
90+
# Sabo driver
91+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_cabo_driver_base.cpp
92+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_controller.cpp
93+
src/drivers/ui/SaboCoverUI/sabo_cover_ui_display_driver_uc1698.cpp
9894
# Raw driver debug interface
9995
src/debug/debug_tcp_interface.cpp
10096
src/debug/debug_udp_interface.cpp
@@ -117,7 +113,6 @@ target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
117113
# Add user defined symbols
118114
timegm=mktime
119115
ROBOT_PLATFORM=${ROBOT_PLATFORM}
120-
ROBOT_PLATFORM_${ROBOT_PLATFORM}=1
121116
)
122117

123118
# Add linked libraries
@@ -128,26 +123,16 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC
128123
etl::etl
129124
LittleFS
130125
lwjson
126+
lvgl
131127
)
132128

133-
# Sabo specific files and libraries (LVGL)
134-
if(ROBOT_PLATFORM STREQUAL "Sabo")
135-
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC lvgl)
136-
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
137-
src/drivers/ui/SaboCoverUI/sabo_cover_ui_cabo_driver_base.cpp
138-
src/drivers/ui/SaboCoverUI/sabo_cover_ui_controller.cpp
139-
src/drivers/ui/SaboCoverUI/sabo_cover_ui_display_driver_uc1698.cpp
140-
)
141-
endif()
142-
143129
target_add_service(${CMAKE_PROJECT_NAME} ImuService ${CMAKE_CURRENT_SOURCE_DIR}/services/imu_service.json)
144130
target_add_service(${CMAKE_PROJECT_NAME} PowerService ${CMAKE_CURRENT_SOURCE_DIR}/services/power_service.json)
145131
target_add_service(${CMAKE_PROJECT_NAME} EmergencyService ${CMAKE_CURRENT_SOURCE_DIR}/services/emergency_service.json)
146132
target_add_service(${CMAKE_PROJECT_NAME} DiffDriveService ${CMAKE_CURRENT_SOURCE_DIR}/services/diff_drive_service.json)
147133
target_add_service(${CMAKE_PROJECT_NAME} MowerService ${CMAKE_CURRENT_SOURCE_DIR}/services/mower_service.json)
148134
target_add_service(${CMAKE_PROJECT_NAME} GpsService ${CMAKE_CURRENT_SOURCE_DIR}/services/gps_service.json)
149135
target_add_service(${CMAKE_PROJECT_NAME} InputService ${CMAKE_CURRENT_SOURCE_DIR}/services/input_service.json)
150-
target_add_service(${CMAKE_PROJECT_NAME} HighLevelService ${CMAKE_CURRENT_SOURCE_DIR}/services/high_level_service.json)
151136

152137
set_target_properties(${CMAKE_PROJECT_NAME}
153138
PROPERTIES SUFFIX ".elf")

ext/CMakeLists.txt

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

13-
# LVGL Configuration - Disable examples and demos to reduce compile time and binary size
1413
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
15-
set(CONFIG_LV_BUILD_EXAMPLES OFF CACHE BOOL "Disable LVGL examples" FORCE)
16-
set(CONFIG_LV_BUILD_DEMOS OFF CACHE BOOL "Disable LVGL demos" FORCE)
14+
set(CONFIG_LV_BUILD_EXAMPLES OFF)
15+
set(CONFIG_LV_BUILD_DEMOS OFF)
1716
set(CONFIG_LV_USE_THORVG_INTERNAL OFF)
18-
set(LV_CONF_BUILD_DISABLE_EXAMPLES ON CACHE BOOL "Disable LVGL examples build" FORCE)
19-
set(LV_CONF_BUILD_DISABLE_DEMOS ON CACHE BOOL "Disable LVGL demos build" FORCE)
20-
21-
# Add LVGL only for specific robots
22-
if(ROBOT_PLATFORM STREQUAL "Sabo")
23-
add_subdirectory(lvgl)
24-
endif()
17+
add_subdirectory(lvgl)
2518

2619
# Add LittleFS
2720
add_library(LittleFS littlefs/lfs.c littlefs/lfs_util.c)

src/drivers/ui/SaboCoverUI/lv_conf.h renamed to lv_conf.h

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
/**
22
* @file lv_conf.h
3-
* Configuration file for LVGL v9.3 - Sabo Robot CoverUI
4-
* This file should only be included via the main lv_conf.h dispatcher
3+
* Configuration file for v9.3.0
54
*/
65

6+
/*
7+
* Copy this file as `lv_conf.h`
8+
* 1. simply next to `lvgl` folder
9+
* 2. or to any other place and
10+
* - define `LV_CONF_INCLUDE_SIMPLE`;
11+
* - add the path as an include path.
12+
*/
13+
14+
/* clang-format off */
15+
#if 1 /* Set this to "1" to enable content */
16+
717
#ifndef LV_CONF_H
818
#define LV_CONF_H
919

20+
/* If you need to include anything here, do it inside the `__ASSEMBLY__` guard */
21+
#if 0 && defined(__ASSEMBLY__)
22+
#include "my_include.h"
23+
#endif
24+
1025
/*====================
1126
COLOR SETTINGS
1227
*====================*/
@@ -603,8 +618,8 @@
603618
#define LV_FONT_SOURCE_HAN_SANS_SC_16_CJK 0 /**< 1338 most common CJK radicals */
604619

605620
/** Pixel perfect monospaced fonts */
606-
#define LV_FONT_UNSCII_8 0
607-
#define LV_FONT_UNSCII_16 0
621+
#define LV_FONT_UNSCII_8 1
622+
#define LV_FONT_UNSCII_16 1
608623

609624
/** Optionally declare custom fonts here.
610625
*
@@ -618,7 +633,7 @@
618633
#define LV_FONT_CUSTOM_DECLARE
619634

620635
/** Always set a default font */
621-
#define LV_FONT_DEFAULT &lv_font_montserrat_14
636+
#define LV_FONT_DEFAULT &lv_font_unscii_8
622637

623638
/** Enable handling large font and/or fonts with a lot of characters.
624639
* The limit depends on the font size, font face and bpp.
@@ -799,7 +814,7 @@
799814
* https://docs.lvgl.io/master/details/common-widget-features/styles/styles.html#themes . */
800815

801816
/** A simple, impressive and very complete theme */
802-
#define LV_USE_THEME_DEFAULT 1
817+
#define LV_USE_THEME_DEFAULT 0
803818
#if LV_USE_THEME_DEFAULT
804819
/** 0: Light mode; 1: Dark mode */
805820
#define LV_THEME_DEFAULT_DARK 0
@@ -812,7 +827,7 @@
812827
#endif /*LV_USE_THEME_DEFAULT*/
813828

814829
/** A very simple theme that is a good starting point for a custom theme */
815-
#define LV_USE_THEME_SIMPLE 1
830+
#define LV_USE_THEME_SIMPLE 0
816831

817832
/** A theme designed for monochrome displays */
818833
#define LV_USE_THEME_MONO 1
@@ -1194,4 +1209,8 @@
11941209
/** Build the demos */
11951210
#define LV_BUILD_DEMOS 0
11961211

1197-
#endif /*LV_CONF_SABO_H*/
1212+
/*--END OF LV_CONF_H--*/
1213+
1214+
#endif /*LV_CONF_H*/
1215+
1216+
#endif /*End of "Content enable"*/

robots/src/robot.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,18 @@
33
#include <services.hpp>
44

55
#include "../include/lyfco_e1600_robot.hpp"
6-
#if ROBOT_PLATFORM_Sabo
76
#include "../include/sabo_robot.hpp"
8-
#endif
97
#include "../include/worx_robot.hpp"
108
#include "../include/xbot_robot.hpp"
119
#include "../include/yardforce_robot.hpp"
1210

11+
#define EXPAND(x) x
12+
#define ROBOT_CLASS_NAME(platform) platform##Robot
13+
#define CREATE_ROBOT(platform) new EXPAND(ROBOT_CLASS_NAME(platform))()
14+
1315
Robot* GetRobot() {
14-
// TODO: This should look at the flash to determine the mower type.
15-
#if ROBOT_PLATFORM_Sabo
16-
return new SaboRobot();
17-
#elif ROBOT_PLATFORM_YardForce
18-
return new YardForceRobot();
19-
#elif ROBOT_PLATFORM_Worx
20-
return new WorxRobot();
21-
#elif ROBOT_PLATFORM_Lyfco_E1600
22-
return new Lyfco_E1600Robot();
23-
#elif ROBOT_PLATFORM_xBot
24-
return new xBotRobot();
25-
#else
26-
#error "Unknown ROBOT_PLATFORM"
27-
#endif
16+
// TODO: This should look at the flash to determine the mower type.
17+
return CREATE_ROBOT(ROBOT_PLATFORM);
2818
}
2919

3020
void MowerRobot::InitMotors() {

src/drivers/ui/SaboCoverUI/sabo_cover_ui_display.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#ifndef OPENMOWER_SABO_COVER_UI_DISPLAY_HPP
66
#define OPENMOWER_SABO_COVER_UI_DISPLAY_HPP
77

8+
#include <lvgl.h>
89
#include <ulog.h>
910

1011
#include <cstring>
1112

1213
#include "ch.h"
13-
#include "lvgl.h"
1414
#include "sabo_cover_ui_defs.hpp"
1515
#include "sabo_cover_ui_display_driver_uc1698.hpp"
1616

src/drivers/ui/SaboCoverUI/sabo_cover_ui_display_driver_uc1698.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#include <ch.h>
2626
#include <hal.h>
27+
#include <lvgl.h>
2728

28-
#include "lvgl.h"
2929
#include "sabo_cover_ui_defs.hpp"
3030

3131
namespace xbot::driver::ui {

src/services.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ImuService imu_service{xbot::service_ids::IMU};
1515
PowerService power_service{xbot::service_ids::POWER};
1616
GpsService gps_service{xbot::service_ids::GPS};
1717
InputService input_service{xbot::service_ids::INPUT};
18-
HighLevelService high_level_service{xbot::service_ids::HIGH_LEVEL};
1918

2019
void StartServices() {
2120
#define START_IF_NEEDED(service, id) \
@@ -37,5 +36,4 @@ void StartServices() {
3736
START_IF_NEEDED(mower_service, MOWER)
3837
START_IF_NEEDED(gps_service, GPS)
3938
START_IF_NEEDED(input_service, INPUT)
40-
START_IF_NEEDED(high_level_service, HIGH_LEVEL)
4139
}

src/services.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "services/diff_drive_service/diff_drive_service.hpp"
55
#include "services/emergency_service/emergency_service.hpp"
66
#include "services/gps_service/gps_service.hpp"
7-
#include "services/high_level_service/high_level_service.hpp"
87
#include "services/imu_service/imu_service.hpp"
98
#include "services/input_service/input_service.hpp"
109
#include "services/mower_service/mower_service.hpp"
@@ -17,7 +16,6 @@ extern ImuService imu_service;
1716
extern PowerService power_service;
1817
extern GpsService gps_service;
1918
extern InputService input_service;
20-
extern HighLevelService high_level_service;
2119

2220
void StartServices();
2321

src/services/high_level_service/high_level_service.cpp

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)