Skip to content

Commit

Permalink
Merge branch 'main' into cnc
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-github committed May 2, 2024
2 parents 6de228f + bc04175 commit 9e6c11b
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 49 deletions.
4 changes: 2 additions & 2 deletions cmake/targets/ESP32S3_BZM_TFT35_GT911.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ if(ESP32S3_BZM_TFT35_GT911)
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_BZM_TFT35_GT911/sdkconfig)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_BZM_TFT35_GT911/components)
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_BZM_TFT35_GT911/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
endif()
6 changes: 3 additions & 3 deletions cmake/targets/ESP32S3_CUSTOM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ if(ESP32S3_CUSTOM)
set(TFT_TARGET "ESP32S3_CUSTOM")
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_CUSTOM/sdkconfig)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_CUSTOM/components)
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_CUSTOM/components/bsp")
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_CUSTOM/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
endif()
6 changes: 3 additions & 3 deletions cmake/targets/ESP32S3_FREENOVE_1_1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ if(ESP32S3_FREENOVE_1_1)
set(TFT_TARGET "ESP32S3_FREENOVE_1_1")
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_FREENOVE_1_1/sdkconfig)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_FREENOVE_1_1/components)
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_FREENOVE_1_1/components/bsp")
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_FREENOVE_1_1/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
unset(TFT_UI_SERVICE CACHE)
endif()
4 changes: 2 additions & 2 deletions cmake/targets/ESP32S3_HMI43V3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ if(ESP32S3_HMI43V3)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_video_i80)
# Add specific bsp path for board definition
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_HMI43V3/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
endif()
4 changes: 2 additions & 2 deletions cmake/targets/ESP32S3_SEEED_STUDIO_XIAO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ if(ESP32S3_SEEED_STUDIO_XIAO)
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_SEEED_STUDIO_XIAO/sdkconfig)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_SEEED_STUDIO_XIAO/components)
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_SEEED_STUDIO_XIAO/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
unset(TFT_UI_SERVICE CACHE)
endif()
6 changes: 3 additions & 3 deletions cmake/targets/ESP32S3_ZX3D50CE02S_USRC_4832.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ if(ESP32S3_ZX3D50CE02S_USRC_4832)
set(SDKCONFIG ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_ZX3D50CE02S_USRC_4832/sdkconfig)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/ESP32S3_ZX3D50CE02S_USRC_4832/components)
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_video_i80)
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_ZX3D50CE02S_USRC_4832/components/bsp")
add_compile_options("-I${CMAKE_SOURCE_DIR}/hardware/ESP32S3_ZX3D50CE02S_USRC_4832/components/bsp")
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
if (USB_SERIAL_SERVICE)
# Enable USB-OTG as serial alternative for communications
add_compile_options(-DESP3D_USB_SERIAL_FEATURE=1)
# Add specific usb driver for otg
list(APPEND EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/hardware/drivers_usb_otg)
endif()
endif()
41 changes: 21 additions & 20 deletions hardware/ESP32S3_BZM_TFT35_GT911/components/bsp/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,6 @@ esp_err_t bsp_init(void)
}
}
}
esp3d_log("Attaching display panel to SPI bus...");
esp_lcd_panel_io_handle_t disp_io_handle;
display_spi_st7262_cfg.disp_spi_cfg.on_color_trans_done = disp_flush_ready;
if (esp_lcd_new_panel_io_spi(
(esp_lcd_spi_bus_handle_t)(display_spi_st7262_cfg.spi_bus_config
.spi_host_index),
&(display_spi_st7262_cfg.disp_spi_cfg), &disp_io_handle) != ESP_OK)
{
esp3d_log_e("Failed to attach display panel to SPI bus");
return ESP_FAIL;
}

/* Display panel initialization */
esp3d_log("Initializing display...");
if (esp_lcd_new_panel_st7796(disp_io_handle, &display_spi_st7262_cfg,
&disp_panel) != ESP_OK)
{
esp3d_log_e("Failed to initialize display panel");
return ESP_FAIL;
}

/* i2c controller initialization */
esp3d_log("Initializing i2C controller...");
Expand Down Expand Up @@ -193,6 +173,27 @@ esp_err_t bsp_init(void)
#endif // ESP3D_CAMERA_FEATURE

#if ESP3D_DISPLAY_FEATURE

esp3d_log("Attaching display panel to SPI bus...");
esp_lcd_panel_io_handle_t disp_io_handle;
display_spi_st7262_cfg.disp_spi_cfg.on_color_trans_done = disp_flush_ready;
if (esp_lcd_new_panel_io_spi(
(esp_lcd_spi_bus_handle_t)(display_spi_st7262_cfg.spi_bus_config
.spi_host_index),
&(display_spi_st7262_cfg.disp_spi_cfg), &disp_io_handle) != ESP_OK)
{
esp3d_log_e("Failed to attach display panel to SPI bus");
return ESP_FAIL;
}

/* Display panel initialization */
esp3d_log("Initializing display...");
if (esp_lcd_new_panel_st7796(disp_io_handle, &display_spi_st7262_cfg,
&disp_panel) != ESP_OK)
{
esp3d_log_e("Failed to initialize display panel");
return ESP_FAIL;
}
/* Display panel initialization */
esp_lcd_panel_invert_color(disp_panel, true);
/* Touch controller initialization */
Expand Down
2 changes: 1 addition & 1 deletion hardware/ESP32S3_HMI43V3/components/bsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
idf_component_register(
SRCS "bsp.c"
INCLUDE_DIRS .
REQUIRES esp3d_log lvgl i2c_bus ft5x06 rm68120 tca9554 usb_serial
REQUIRES "esp3d_log lvgl i2c_bus ft5x06 rm68120 tca9554 usb_serial"
)
9 changes: 4 additions & 5 deletions hardware/drivers_common/camera/esp32_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
*********************/

#include "esp32_camera.h"

#include <string.h>

#include "esp3d_log.h"



/**********************
* STATIC VARIABLES
**********************/
Expand Down Expand Up @@ -73,16 +72,16 @@ esp_err_t esp32_camera_init(const esp32_camera_config_t *config) {
_camera_pin_led = config->pin_led;
}
// Save camera name
_camera_name = (char *)calloc(strlen(config->name) + 1, sizeof(char));
_camera_name = (char *)calloc(strlen(config->name) + 1, sizeof(char));
if (_camera_name == NULL) {
esp3d_log_e("Camera name allocation failed");
return ESP_ERR_NO_MEM;
}
_camera_name = strcpy(_camera_name, config->name);

// Initilize camera
esp3d_log("Camera init") esp_err_t err =
esp_camera_init(&(config->hw_config));
esp3d_log("Camera init");
esp_err_t err = esp_camera_init(&(config->hw_config));
if (err != ESP_OK) {
esp3d_log_e("Camera init failed with error 0x%x", err);
return err;
Expand Down
2 changes: 1 addition & 1 deletion main/core/commands/esp420.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void ESP3DCommands::ESP420(int cmd_params_pos, ESP3DMessage *msg) {
// camera name
tmpstr = esp3d_camera.GetModelString();
tmpstr += "(";
tmpstr += esp3d_camera.GetModel();
tmpstr += std::to_string(esp3d_camera.GetModel());
tmpstr += ")";

if (!dispatchIdValue(json, "camera name", tmpstr.c_str(), target,
Expand Down
2 changes: 1 addition & 1 deletion main/modules/http/esp3d_http_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ void ESP3DHttpService::onClose(int socketFd) {

bool ESP3DHttpService::begin() {
esp3d_log("Starting Http Service");

end();
// check if start
if (ESP3DState::on !=
Expand Down Expand Up @@ -672,6 +671,7 @@ bool ESP3DHttpService::begin() {
} else {
esp3d_log_e("Web server start failed %s", esp_err_to_name(err));
}
esp3d_log("Http Service started %s", _started ? "successfully" : "failed");
return _started;
}

Expand Down
29 changes: 23 additions & 6 deletions main/modules/network/esp3d_network_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,47 @@ ESP3DNetworkServices::ESP3DNetworkServices() { _started = false; }
ESP3DNetworkServices::~ESP3DNetworkServices() {}

bool ESP3DNetworkServices::begin() {
bool start = false;
esp3dTftValues.set_string_value(ESP3DValuesIndex::network_status, "+");
esp3d_log("Starting Services");
_started = esp3dAuthenthicationService.begin();
esp3d_log("Starting autenthication Service %s", _started ? "OK" : "KO");
#if ESP3D_TIMESTAMP_FEATURE
_started = _started && esp3dTimeService.begin();
start = esp3dTimeService.begin();
esp3d_log("Starting Time Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_TIMESTAMP_FEATURE

#if ESP3D_HTTP_FEATURE
_started = _started && esp3dHttpService.begin();
start = esp3dHttpService.begin();
esp3d_log("Starting Http Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_HTTP_FEATURE

#if ESP3D_NOTIFICATIONS_FEATURE
_started = _started && esp3dNotificationsService.begin(true);
start = esp3dNotificationsService.begin(true);
esp3d_log("Starting Notifications Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_NOTIFICATIONS_FEATURE

#if ESP3D_MDNS_FEATURE
_started = _started && esp3dmDNS.begin();
start = esp3dmDNS.begin();
esp3d_log("Starting mDNS Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_MDNS_FEATURE

#if ESP3D_SSDP_FEATURE
_started = _started && esp3d_ssdp_service.begin();
start = esp3d_ssdp_service.begin();
esp3d_log("Starting SSDP Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_SSDP_FEATURE

#if ESP3D_TELNET_FEATURE
_started = _started && esp3dSocketServer.begin();
start = esp3dSocketServer.begin();
esp3d_log("Starting Telnet Service %s", start ? "OK" : "KO");
_started = _started && start;
#endif // ESP3D_TELNET_FEATURE
esp3d_log("Services started %s", _started ? "OK" : "KO");
return _started;
}

Expand Down
2 changes: 2 additions & 0 deletions main/modules/translations/esp3d_translation_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ bool ESP3DTranslationService::begin() {
esp3d_log("Using default language pack: %s",
translate(ESP3DLabel::language));
_started = true;
esp3d_log("Start is %s", _started?"Ok":"KO");
return _started;
}
esp3d_log("Using language pack: %s over %s", filename.c_str(),
Expand Down Expand Up @@ -112,6 +113,7 @@ bool ESP3DTranslationService::begin() {
_languageCode = DEFAULT_LANGUAGE;
_started = true;
}
esp3d_log("Start is %s", _started?"Ok":"KO");
return _started;
}

Expand Down

0 comments on commit 9e6c11b

Please sign in to comment.