主要更改包括: 1. 传感器功能改进: - 实现水位传感器状态变化检测,正确处理有水/无水状态 - 优化温湿度数据显示,使用更清晰的格式 2. LCD界面优化: - 适配80*160屏幕尺寸,调整所有页面布局 - 温湿度页面:使用"C"作为温度单位,优化显示位置 - 食物重量页面:调整显示位置,简化状态文本 - 水位页面:替换圆形图标为矩形背景,提升视觉效果 - 系统状态页面:简化状态文本,优化布局 - 统一标题栏设计,添加分隔线 3. 功能增强: - 实现ST7735_DrawLine函数,用于绘制分隔线 - 实现ST7735_FillCircle函数,用于图形绘制 - 添加步进电机驱动代码,支持电机控制 4. 其他优化: - 修复未使用变量的编译警告 - 调整字体大小和显示位置,提高可读性 - 优化颜色方案,提升视觉体验 这些更改使界面更加美观、清晰,同时增强了系统的功能和稳定性。
100 lines
2.7 KiB
CMake
100 lines
2.7 KiB
CMake
cmake_minimum_required(VERSION 3.22)
|
|
|
|
#
|
|
# 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)
|
|
|
|
|
|
# Define the build type
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
endif()
|
|
|
|
# Set the project name
|
|
set(CMAKE_PROJECT_NAME hahha)
|
|
|
|
# Enable compile command to ease indexing with e.g. clangd
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
|
|
|
# Core project settings
|
|
project(${CMAKE_PROJECT_NAME})
|
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
|
|
|
# Enable CMake support for ASM and C languages
|
|
enable_language(C ASM)
|
|
|
|
# Create an executable object type
|
|
add_executable(${CMAKE_PROJECT_NAME}
|
|
# Add user sources here
|
|
Core/Bsp/easylogger/inc/elog.h
|
|
Core/Bsp/easylogger/port/elog_port.c
|
|
Core/Bsp/easylogger/src/elog.c
|
|
Core/Bsp/easylogger/src/elog_utils.c
|
|
Core/Bsp/BSP_WF_24/dx_wf_24.c
|
|
Core/Bsp/BSP_Device/device_ctrl/device_ctrl.c
|
|
Core/Bsp/BSP_Device/spi_st7735s/spi_st7735s.c
|
|
Core/Bsp/BSP_Device/spi_st7735s/fonts.c
|
|
Core/Bsp/BSP_Device/bsp_mp3/mp3_driver.c
|
|
Core/Bsp/MultiButton-master/Multi_Button.c
|
|
Core/Bsp/BSP_Device/bsp_aht30/bsp_aht30.c
|
|
Core/Bsp/BSP_Device/bsp_rtc/bsp_rtc.c
|
|
Core/Bsp/bsp_motor/stepper_motor.c
|
|
)
|
|
# Add STM32CubeMX generated sources
|
|
add_subdirectory(cmake/stm32cubemx)
|
|
|
|
# Link directories setup
|
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# Add user defined library search paths
|
|
)
|
|
|
|
# Add sources to executable
|
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# Add user sources here
|
|
)
|
|
|
|
# Add include paths
|
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# Add user defined include paths
|
|
Core/Bsp/easylogger
|
|
Core/Bsp/easylogger/inc
|
|
Core/Bsp/easylogger/port
|
|
Core/Bsp/easylogger/src
|
|
Core/Bsp/BSP_WF_24
|
|
Core/Bsp/BSP_Device/device_ctrl
|
|
Core/Bsp/BSP_Device/spi_st7735s
|
|
Core/Bsp/BSP_Device/bsp_mp3
|
|
Core/Bsp/MultiButton-master
|
|
Core/Bsp/BSP_Device/bsp_aht30
|
|
Core/Bsp/BSP_Device/bsp_rtc
|
|
Core/Bsp/bsp_motor
|
|
)
|
|
|
|
# Add project symbols (macros)
|
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
|
# Add user defined symbols
|
|
)
|
|
|
|
# Remove wrong libob.a library dependency when using cpp files
|
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ob)
|
|
|
|
# Enable float support for printf
|
|
target_link_options(${CMAKE_PROJECT_NAME} PRIVATE
|
|
-u _printf_float
|
|
)
|
|
|
|
# Add linked libraries
|
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
|
stm32cubemx
|
|
|
|
# Add user defined libraries
|
|
)
|