Skip to content

Commit

Permalink
Refactorization of make files to make them more readable (comment/ co…
Browse files Browse the repository at this point in the history
…lors / status)

Add development define to disable telnet welcome message if necessary
bump version
  • Loading branch information
luc-github committed Jul 9, 2024
1 parent f035f28 commit 0ef520f
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 105 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ OPTION(ESP32S3_CUSTOM "HARDWARE TARGET is ESP32S3 custom board" OFF)
OPTION(ESP32_CUSTOM "HARDWARE TARGET is ESP32 custom board" OFF)


# #######################################
# ===========================================
# Optionally: Select hardware mods applied
# #######################################
# ===========================================
#only for ESP32S3_8048S070C OR ESP32S3_8048S050C OR ESP32S3_8048S043C OR ESP32S3_4827S043C OR ESP32_3248S035C
OPTION(HARDWARE_MOD_GT911_INT "Hardware Mod: GT911 INT pin" OFF)

Expand All @@ -36,18 +36,18 @@ OPTION(HARDWARE_MOD_EXT_PSRAM "Hardware Mod: External PSRAM" OFF)



# #######################################
# ===========================================
# Select one targeted firmware
# #######################################
OPTION(TARGET_FW_MARLIN "Marlin firmware" OFF)
# ===========================================
OPTION(TARGET_FW_MARLIN "Marlin firmware" ON)
OPTION(TARGET_FW_REPETIER "Repetier firmware" OFF)
OPTION(TARGET_FW_SMOOTHIEWARE "Smoothieware firmware" OFF)
OPTION(TARGET_FW_GRBL "GRBL firmware" ON)
OPTION(TARGET_FW_GRBL "GRBL firmware"OFF)


# #######################################
# ===========================================
# Select the Features
# #######################################
# ===========================================
OPTION(ESP3D_AUTHENTICATION "Authentication on all clients" OFF)
OPTION(DISABLE_SERIAL_AUTHENTICATION "Disable Serial Authentication" ON)
OPTION(TIME_SERVICE "Time service" ON)
Expand All @@ -67,9 +67,9 @@ OPTION(UPDATE_SERVICE "Update service" ON)
OPTION(USB_SERIAL_SERVICE "Use USB Serial if Available" ON)
OPTION(USE_FAT_INSTEAD_OF_LITTLEFS "Use FAT instead of LittleFS" OFF)

# #######################################
# Do not change anything below this line
# #######################################
# ===========================================
# Internal Configuration (Do Not Modify)
# ===========================================

set(PLATFORMS_LIST
ESP32S3_HMI43V3
Expand Down
63 changes: 47 additions & 16 deletions cmake/dev_tools.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
# ESP3D-TFT specific log level
# All = 3
# Debug = 2
# Error only = 1
# Disabled = 0
add_compile_options(-DESP3D_TFT_LOG=1)
# Disable ANSI color to fit some serial terminals
add_compile_options(-DDISABLE_COLOR_LOG=0)

#Use the Snapshot API of LVGL to dump screens to the SD card
add_compile_options(-DLV_USE_SNAPSHOT=1)

# ESP3D-TFT specific bechmark
# Enabled = 1
# Disabled = 0
add_compile_options(-DESP3D_TFT_BENCHMARK=0)
# ESP3D-TFT Development Configuration

# ===========================================
# Logging Configuration
# ===========================================

# ESP3D-TFT Log Level
# 3 = All
# 2 = Debug
# 1 = Error only
# 0 = Disabled
set(ESP3D_TFT_LOG_LEVEL 0)
add_compile_options(-DESP3D_TFT_LOG=${ESP3D_TFT_LOG_LEVEL})

# ANSI Color in Logs
# 0 = Enabled (default)
# 1 = Disabled (for compatibility with some serial terminals)
set(DISABLE_COLOR_LOG 0)
add_compile_options(-DDISABLE_COLOR_LOG=${DISABLE_COLOR_LOG})

# ===========================================
# LVGL Configuration
# ===========================================

# Use the Snapshot API of LVGL to dump screens to the SD card
set(LV_USE_SNAPSHOT 0)
add_compile_options(-DLV_USE_SNAPSHOT=${LV_USE_SNAPSHOT})

# ===========================================
# Telnet Configuration
# ===========================================
# Disable telnet server welcome message for compatibility with some serial terminals
# 1 = Disable telnet server welcome message
# 0 = Keep telnet server welcome message

set(DISABLE_TELNET_WELCOME_MESSAGE 0)
add_compile_options(-DDISABLE_TELNET_WELCOME_MESSAGE=${DISABLE_TELNET_WELCOME_MESSAGE})

# ===========================================
# Performance Configuration
# ===========================================

# ESP3D-TFT Benchmark
# 1 = Enabled
# 0 = Disabled
set(ESP3D_TFT_BENCHMARK 0)
add_compile_options(-DESP3D_TFT_BENCHMARK=${ESP3D_TFT_BENCHMARK})
125 changes: 101 additions & 24 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@

# DO NOT EDIT THIS FILE
# Firmware target

# ===========================================
# Firmware target configuration
# ===========================================
if(TARGET_FW_MARLIN)
add_compile_options(-DTARGET_IS_MARLIN=1)
if(TFT_UI_SERVICE)
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/display/3dprinter/marlin")
endif()
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/target/3dprinter/marlin")
elseif(TARGET_FW_REPETIER)
add_compile_options(-DTARGET_IS_REPETIER=1)
if(TFT_UI_SERVICE)
add_compile_options(-DTARGET_IS_REPETIER=1)
if(TFT_UI_SERVICE)
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/display/3dprinter/repetier")
endif()
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/target/3dprinter/repetier")
elseif(TARGET_FW_SMOOTHIEWARE)
add_compile_options(-DTARGET_IS_SMOOTHIEWARE=1)
if(TFT_UI_SERVICE)
add_compile_options(-DTARGET_IS_SMOOTHIEWARE=1)
if(TFT_UI_SERVICE)
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/display/3dprinter/smoothieware")
endif()
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/target/3dprinter/smoothieware")
elseif(TARGET_FW_GRBL)
add_compile_options(-DTARGET_IS_GRBL=1)
if(TFT_UI_SERVICE)
add_compile_options(-DTARGET_IS_GRBL=1)
if(TFT_UI_SERVICE)
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/display/cnc/grbl")
endif()
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/target/cnc/grbl")
endif()

# Add the dev tools settings
# ===========================================
# Development tools
# ===========================================
include(cmake/dev_tools.cmake)

# Features
# ===========================================
# Core Features
# ===========================================
# File system selection
if(USE_FAT_INSTEAD_OF_LITTLEFS)
add_compile_options(-DESP3D_FATFS_FEATURE=1)
else()
add_compile_options(-DESP3D_LITTLEFS_FEATURE=1)
endif()

# Authentication
if(ESP3D_AUTHENTICATION)
add_compile_options(-DESP3D_AUTHENTICATION_FEATURE=1)
endif()
Expand All @@ -45,10 +53,14 @@ if(DISABLE_SERIAL_AUTHENTICATION)
add_compile_options(-DESP3D_DISABLE_SERIAL_AUTHENTICATION_FEATURE=1)
endif()

# Time service
if(TIME_SERVICE)
add_compile_options(-DESP3D_TIMESTAMP_FEATURE=1)
endif()

# ===========================================
# Network Services
# ===========================================
if(WIFI_SERVICE)
add_compile_options(-DESP3D_WIFI_FEATURE=1)

Expand Down Expand Up @@ -86,39 +98,104 @@ if(BT_SERVICE)
add_compile_options(-DESP3D_BLUETOOTH_FEATURE=1)
endif()

# ===========================================
# User Interface
# ===========================================
if(TFT_UI_SERVICE)
add_compile_options(-DESP3D_DISPLAY_FEATURE=1)
# For lvgl_conf to use simple path
add_compile_options(-DLV_CONF_INCLUDE_SIMPLE=1)
add_compile_options(-DLV_LVGL_H_INCLUDE_SIMPLE=1)
add_compile_options("-I${CMAKE_SOURCE_DIR}/main/display")
else()
else()
add_compile_options(-DLV_CONF_SUPPRESS_DEFINE_CHECK=1)
endif()

# ===========================================
# Storage and Updates
# ===========================================
if(SD_CARD_SERVICE)
add_compile_options(-DESP3D_SD_CARD_FEATURE=1)
if(UPDATE_SERVICE)
add_compile_options(-DESP3D_UPDATE_FEATURE=1)
endif()
else()
unset(UPDATE_SERVICE CACHE)
unset(UPDATE_SERVICE CACHE)
endif()


# Add entry point for customizations headers
# ===========================================
# Customizations
# ===========================================
add_compile_options("-I${CMAKE_SOURCE_DIR}/customizations")

add_compile_options(-DTFT_TARGET="${TFT_TARGET}")

# check the configuration
include (cmake/sanity_check.cmake)
# ===========================================
# Configuration Check
# ===========================================
include(cmake/sanity_check.cmake)

# ===========================================
# Configuration Summary
# ===========================================
# ===========================================
# Final Configuration Summary
# ===========================================

message(STATUS "")
message(STATUS "${BoldCyan}Configuration Summary:${ColourReset}")
message(STATUS "${Cyan}------------------------${ColourReset}")
message(STATUS "${Cyan}PROJECT_NAME: ${White}ESP3D TFT${ColourReset}")
message(STATUS "${Cyan}Hardware Target: ${White}${board_target}${ColourReset}")
message(STATUS "${Cyan}Firmware Target: ${White}${fw_target}${ColourReset}")
message(STATUS "${Cyan}Platform: ${White}${IDF_TARGET}${ColourReset}")
message(STATUS "${Cyan}WiFi: ${White}${WIFI_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}Bluetooth: ${White}${BT_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}TFT UI: ${White}${TFT_UI_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}SD Card: ${White}${SD_CARD_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}Update Service: ${White}${UPDATE_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}Use FAT instead of LittleFS: ${White}${USE_FAT_INSTEAD_OF_LITTLEFS} ${ColourReset}")
message(STATUS "${Cyan}Authentication: ${White}${ESP3D_AUTHENTICATION} ${ColourReset}")
message(STATUS "${Cyan}Time Service: ${White}${TIME_SERVICE} ${ColourReset}")
message(STATUS "${Cyan}------------------------${ColourReset}")
message(STATUS "")


# ===========================================
# Development Configuration Summary
# ===========================================
if(ESP3D_TFT_LOG_LEVEL EQUAL 0)
set(TFT_LOG_LEVEL_STATUS "Disabled")
else()
set(TFT_LOG_LEVEL_STATUS "${ESP3D_TFT_LOG_LEVEL}")
endif()
if (DISABLE_COLOR_LOG EQUAL 1)
set(TFT_LOG_COLOR_STATUS "Disabled")
else()
set(TFT_LOG_COLOR_STATUS "Enabled")
endif()
if (LV_USE_SNAPSHOT EQUAL 1)
set(TFT_LVGL_SNAPSHOT_STATUS "Enabled")
else()
set(TFT_LVGL_SNAPSHOT_STATUS "Disabled")
endif()
if (ESP3D_TFT_BENCHMARK EQUAL 1)
set(TFT_BENCHMARK_STATUS "Enabled")
else()
set(TFT_BENCHMARK_STATUS "Disabled")
endif()
if (DISABLE_TELNET_WELCOME_MESSAGE EQUAL 1)
set(TFT_TELNET_WELCOME_MESSAGE_STATUS "Disabled")
else()
set(TFT_TELNET_WELCOME_MESSAGE_STATUS "Enabled")
endif()

# Status
message(STATUS "")
message(STATUS "----Project definition----")
message(STATUS "PROJECT_NAME = ESP3D TFT")
message(STATUS "TFT_TARGET = ${TFT_TARGET}")
message(STATUS "IDF_TARGET = ${IDF_TARGET}")
message(STATUS "--------------------------")
message(STATUS "")
message(STATUS "${BoldCyan}Development Configuration Summary:${ColourReset}")
message(STATUS "${Cyan}------------------------${ColourReset}")
message(STATUS "${Cyan}Log Level: ${White}${TFT_LOG_LEVEL_STATUS}${ColourReset}")
message(STATUS "${Cyan}ANSI Color in Logs: ${White}${TFT_LOG_COLOR_STATUS}${ColourReset}")
message(STATUS "${Cyan}LVGL Snapshot: ${White}${TFT_LVGL_SNAPSHOT_STATUS}${ColourReset}")
message(STATUS "${Cyan}Benchmark: ${White}${TFT_BENCHMARK_STATUS}${ColourReset}")
message(STATUS "${Cyan}Telnet Welcome Message: ${White}${TFT_TELNET_WELCOME_MESSAGE_STATUS}${ColourReset}")
message(STATUS "${Cyan}------------------------${ColourReset}")
message(STATUS "")
Loading

0 comments on commit 0ef520f

Please sign in to comment.