Skip to content

Commit ed8b40e

Browse files
authored
Eliminate the need for a deep+ scan to speed up builds (#1045)
* make libssh into a component * cast types in console for uart channel * define dependencies to eliminate the need for a deep+ scan * add missing source file * add spaces around macros to eliminate warning
1 parent 5f48522 commit ed8b40e

File tree

7 files changed

+187
-19
lines changed

7 files changed

+187
-19
lines changed

lib/console/Commands/NetworkCommands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void on_ping_end(esp_ping_handle_t hdl, void *args)
9999
} else {
100100
printf("\n--- %s ping statistics ---", inet6_ntoa(*ip_2_ip6(&target_addr)));
101101
}
102-
printf("%"PRIu32" packets transmitted, %"PRIu32" received, %"PRIu32"%% packet loss, time %"PRIu32"ms",
102+
printf("%" PRIu32 " packets transmitted, %" PRIu32 " received, %" PRIu32 "%% packet loss, time %" PRIu32 "ms",
103103
transmitted, received, loss, total_time_ms);
104104
// delete the ping sessions, so that we clean up all resources and can create a new ping session
105105
// we don't have to call delete function in the callback, instead we can call delete function from other tasks

lib/console/Commands/XFERCommands.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ std::string read_until(char delimiter)
2727
while (byte != delimiter)
2828
{
2929
size_t size = 0;
30-
uart_get_buffered_data_len(CONSOLE_UART, &size);
30+
uart_get_buffered_data_len((uart_port_t)CONSOLE_UART, &size);
3131
if (size > 0)
3232
{
33-
int result = uart_read_bytes(CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
33+
int result = uart_read_bytes((uart_port_t)CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
3434
if (result < 1)
3535
{
3636
fprintf(stdout, "3 Error: Response Timeout\r\n");
@@ -75,10 +75,10 @@ int rx(int argc, char **argv)
7575
while (count < size)
7676
{
7777
size_t size = 0;
78-
uart_get_buffered_data_len(CONSOLE_UART, &size);
78+
uart_get_buffered_data_len((uart_port_t)CONSOLE_UART, &size);
7979
if (size > 0)
8080
{
81-
int result = uart_read_bytes(CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
81+
int result = uart_read_bytes((uart_port_t)CONSOLE_UART, &byte, 1, MAX_READ_WAIT_TICKS);
8282
if (result < 1)
8383
break;
8484

lib/console/Console.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ namespace ESP32Console
124124
this->uart_channel_ = channel;
125125

126126
//Reinit the UART driver if the channel was already in use
127-
if (uart_is_driver_installed(channel)) {
128-
uart_driver_delete(channel);
127+
if (uart_is_driver_installed((uart_port_t)channel)) {
128+
uart_driver_delete((uart_port_t)channel);
129129
}
130130

131131
/* Drain stdout before reconfiguring it */
@@ -157,21 +157,21 @@ namespace ESP32Console
157157
};
158158

159159

160-
ESP_ERROR_CHECK(uart_param_config(channel, &uart_config));
160+
ESP_ERROR_CHECK(uart_param_config((uart_port_t)channel, &uart_config));
161161

162162
// Set the correct pins for the UART of needed
163163
if (rxPin > 0 || txPin > 0) {
164164
if (rxPin < 0 || txPin < 0) {
165165
Debug_printv("Both rxPin and txPin has to be passed!");
166166
}
167-
uart_set_pin(channel, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
167+
uart_set_pin((uart_port_t)channel, txPin, rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
168168
}
169169

170170
/* Install UART driver for interrupt-driven reads and writes */
171-
ESP_ERROR_CHECK(uart_driver_install(channel, 256, 0, 0, NULL, 0));
171+
ESP_ERROR_CHECK(uart_driver_install((uart_port_t)channel, 256, 0, 0, NULL, 0));
172172

173173
/* Tell VFS to use UART driver */
174-
esp_vfs_dev_uart_use_driver(channel);
174+
esp_vfs_dev_uart_use_driver((uart_port_t)channel);
175175

176176
esp_console_config_t console_config = {
177177
.max_cmdline_length = max_cmdline_len_,
@@ -272,7 +272,7 @@ namespace ESP32Console
272272
//Debug_printv("Interpolated line: [%s]\n", interpolated_line.c_str());
273273

274274
// Flush trailing CR
275-
uart_flush(CONSOLE_UART);
275+
uart_flush((uart_port_t)CONSOLE_UART);
276276

277277
/* Try to run the command */
278278
int ret;

lib/console/ute/ute.cpp

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

99
#define _DEFAULT_SOURCE
1010
#define _BSD_SOURCE
11-
#define _GNU_SOURCE
11+
//#define _GNU_SOURCE
1212

1313
#include "ute.h"
1414

platformio-ini-files/platformio.common.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extra_scripts =
3434
pre:build_version.py
3535
pre:build_webui.py
3636
; post:build_firmwarezip.py ; Optional, build firmware ZIP file for flash tool
37-
lib_ldf_mode = deep+
37+
lib_ldf_mode = off ; off chain deep chain+ deep+
3838
board_build.filesystem = littlefs
3939

4040
; COM1, /dev/ttyUSB0, /dev/tty.SLAB_USBtoUART etc.

platformio-sample.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ extra_scripts =
112112
pre:build_version.py
113113
pre:build_webui.py
114114
; post:build_firmwarezip.py ; Optional, build firmware ZIP file for flash tool
115-
lib_ldf_mode = deep+
115+
lib_ldf_mode = off ; off chain deep chain+ deep+
116116
upload_speed = 460800 ;921600
117117
;upload_port = COM1 ; Windows
118118
upload_port = /dev/ttyUSB0 ; Linux/WSL

src/CMakeLists.txt

Lines changed: 172 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,174 @@
1-
# This file was automatically generated for projects
2-
# without default 'CMakeLists.txt' file.
1+
cmake_minimum_required(VERSION 3.16.0)
32

4-
FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*)
3+
set(INCLUDES
4+
${CMAKE_SOURCE_DIR}/include
5+
${CMAKE_SOURCE_DIR}/include/pinmap
56

6-
idf_component_register(SRCS ${app_sources})
7+
${CMAKE_SOURCE_DIR}/lib/bus
8+
${CMAKE_SOURCE_DIR}/lib/bus/adamnet
9+
${CMAKE_SOURCE_DIR}/lib/bus/comlynx
10+
${CMAKE_SOURCE_DIR}/lib/bus/cx16_i2c
11+
${CMAKE_SOURCE_DIR}/lib/bus/drivewire
12+
${CMAKE_SOURCE_DIR}/lib/bus/h89
13+
${CMAKE_SOURCE_DIR}/lib/bus/iec
14+
${CMAKE_SOURCE_DIR}/lib/bus/iwm
15+
${CMAKE_SOURCE_DIR}/lib/bus/mac
16+
${CMAKE_SOURCE_DIR}/lib/bus/rc2014bus
17+
${CMAKE_SOURCE_DIR}/lib/bus/rc2014sio
18+
${CMAKE_SOURCE_DIR}/lib/bus/rs232
19+
${CMAKE_SOURCE_DIR}/lib/bus/s100spi
20+
${CMAKE_SOURCE_DIR}/lib/bus/sio
21+
22+
${CMAKE_SOURCE_DIR}/lib/clock
23+
${CMAKE_SOURCE_DIR}/lib/compat
24+
${CMAKE_SOURCE_DIR}/lib/config
25+
26+
${CMAKE_SOURCE_DIR}/lib/console
27+
${CMAKE_SOURCE_DIR}/lib/console/Commands
28+
${CMAKE_SOURCE_DIR}/lib/console/cxxopts
29+
${CMAKE_SOURCE_DIR}/lib/console/Helpers
30+
${CMAKE_SOURCE_DIR}/lib/console/improv
31+
${CMAKE_SOURCE_DIR}/lib/console/ute
32+
33+
${CMAKE_SOURCE_DIR}/lib/device
34+
${CMAKE_SOURCE_DIR}/lib/device/adamnet
35+
${CMAKE_SOURCE_DIR}/lib/device/comlynx
36+
${CMAKE_SOURCE_DIR}/lib/device/cx16_i2c
37+
${CMAKE_SOURCE_DIR}/lib/device/drivewire
38+
${CMAKE_SOURCE_DIR}/lib/device/h89
39+
${CMAKE_SOURCE_DIR}/lib/device/iec
40+
${CMAKE_SOURCE_DIR}/lib/device/iwm
41+
${CMAKE_SOURCE_DIR}/lib/device/mac
42+
${CMAKE_SOURCE_DIR}/lib/device/rc2014
43+
${CMAKE_SOURCE_DIR}/lib/device/rs232
44+
${CMAKE_SOURCE_DIR}/lib/device/s100spi
45+
${CMAKE_SOURCE_DIR}/lib/device/sio
46+
47+
${CMAKE_SOURCE_DIR}/lib/devrelay
48+
${CMAKE_SOURCE_DIR}/lib/devrelay/commands
49+
${CMAKE_SOURCE_DIR}/lib/devrelay/service
50+
${CMAKE_SOURCE_DIR}/lib/devrelay/slip
51+
${CMAKE_SOURCE_DIR}/lib/devrelay/types
52+
53+
${CMAKE_SOURCE_DIR}/lib/display
54+
${CMAKE_SOURCE_DIR}/lib/encoding
55+
${CMAKE_SOURCE_DIR}/lib/encrypt
56+
${CMAKE_SOURCE_DIR}/lib/FileSystem
57+
${CMAKE_SOURCE_DIR}/lib/fn_esp_http_client
58+
${CMAKE_SOURCE_DIR}/lib/fnjson
59+
${CMAKE_SOURCE_DIR}/lib/ftp
60+
${CMAKE_SOURCE_DIR}/lib/fuji
61+
${CMAKE_SOURCE_DIR}/lib/hardware
62+
${CMAKE_SOURCE_DIR}/lib/http
63+
${CMAKE_SOURCE_DIR}/lib/meatloaf
64+
${CMAKE_SOURCE_DIR}/lib/media
65+
${CMAKE_SOURCE_DIR}/lib/modem-sniffer
66+
${CMAKE_SOURCE_DIR}/lib/network-protocol
67+
${CMAKE_SOURCE_DIR}/lib/printer-emulator
68+
${CMAKE_SOURCE_DIR}/lib/qrcode
69+
${CMAKE_SOURCE_DIR}/lib/runcpm
70+
${CMAKE_SOURCE_DIR}/lib/sam
71+
${CMAKE_SOURCE_DIR}/lib/task
72+
${CMAKE_SOURCE_DIR}/lib/tcpip
73+
${CMAKE_SOURCE_DIR}/lib/telnet
74+
${CMAKE_SOURCE_DIR}/lib/tinyxml2
75+
${CMAKE_SOURCE_DIR}/lib/TNFSlib
76+
${CMAKE_SOURCE_DIR}/lib/utils
77+
${CMAKE_SOURCE_DIR}/lib/webdav
78+
)
79+
80+
FILE(GLOB_RECURSE SOURCES
81+
${CMAKE_SOURCE_DIR}/src/*.cpp
82+
83+
${CMAKE_SOURCE_DIR}/lib/bus/*.cpp
84+
${CMAKE_SOURCE_DIR}/lib/bus/adamnet/*.cpp
85+
${CMAKE_SOURCE_DIR}/lib/bus/comlynx/*.cpp
86+
${CMAKE_SOURCE_DIR}/lib/bus/cx16_i2c/*.cpp
87+
${CMAKE_SOURCE_DIR}/lib/bus/drivewire/*.cpp
88+
${CMAKE_SOURCE_DIR}/lib/bus/h89/*.cpp
89+
${CMAKE_SOURCE_DIR}/lib/bus/iec/*.cpp
90+
${CMAKE_SOURCE_DIR}/lib/bus/iwm/*.c
91+
${CMAKE_SOURCE_DIR}/lib/bus/iwm/*.cpp
92+
${CMAKE_SOURCE_DIR}/lib/bus/mac/*.cpp
93+
${CMAKE_SOURCE_DIR}/lib/bus/rc2014bus/*.cpp
94+
${CMAKE_SOURCE_DIR}/lib/bus/rc2014sio/*.cpp
95+
${CMAKE_SOURCE_DIR}/lib/bus/rs232/*.cpp
96+
${CMAKE_SOURCE_DIR}/lib/bus/s100spi/*.cpp
97+
${CMAKE_SOURCE_DIR}/lib/bus/sio/*.cpp
98+
99+
${CMAKE_SOURCE_DIR}/lib/clock/*.cpp
100+
${CMAKE_SOURCE_DIR}/lib/compat/*.c
101+
${CMAKE_SOURCE_DIR}/lib/config/*.cpp
102+
103+
${CMAKE_SOURCE_DIR}/lib/console/*.cpp
104+
${CMAKE_SOURCE_DIR}/lib/console/Commands/*.cpp
105+
${CMAKE_SOURCE_DIR}/lib/console/ute/*.cpp
106+
${CMAKE_SOURCE_DIR}/lib/console/improv/*.cpp
107+
${CMAKE_SOURCE_DIR}/lib/console/Helpers/*.cpp
108+
109+
${CMAKE_SOURCE_DIR}/lib/device/*.cpp
110+
${CMAKE_SOURCE_DIR}/lib/device/adamnet/*.cpp
111+
${CMAKE_SOURCE_DIR}/lib/device/comlynx/*.cpp
112+
${CMAKE_SOURCE_DIR}/lib/device/cx16_i2c/*.cpp
113+
${CMAKE_SOURCE_DIR}/lib/device/drivewire/*.cpp
114+
${CMAKE_SOURCE_DIR}/lib/device/h89/*.cpp
115+
${CMAKE_SOURCE_DIR}/lib/device/iec/*.cpp
116+
${CMAKE_SOURCE_DIR}/lib/device/iwm/*.cpp
117+
${CMAKE_SOURCE_DIR}/lib/device/mac/*.cpp
118+
${CMAKE_SOURCE_DIR}/lib/device/rc2014/*.cpp
119+
${CMAKE_SOURCE_DIR}/lib/device/rs232/*.cpp
120+
${CMAKE_SOURCE_DIR}/lib/device/s100spi/*.cpp
121+
${CMAKE_SOURCE_DIR}/lib/device/sio/*.cpp
122+
123+
${CMAKE_SOURCE_DIR}/lib/devrelay/*.cpp
124+
${CMAKE_SOURCE_DIR}/lib/devrelay/commands/*.cpp
125+
${CMAKE_SOURCE_DIR}/lib/devrelay/service/*.cpp
126+
${CMAKE_SOURCE_DIR}/lib/devrelay/slip/*.cpp
127+
${CMAKE_SOURCE_DIR}/lib/devrelay/types/*.cpp
128+
129+
${CMAKE_SOURCE_DIR}/lib/display/*.cpp
130+
${CMAKE_SOURCE_DIR}/lib/encoding/*.cpp
131+
${CMAKE_SOURCE_DIR}/lib/encrypt/*.cpp
132+
${CMAKE_SOURCE_DIR}/lib/FileSystem/*.cpp
133+
${CMAKE_SOURCE_DIR}/lib/fn_esp_http_client/*.cpp
134+
${CMAKE_SOURCE_DIR}/lib/fnjson/*.cpp
135+
${CMAKE_SOURCE_DIR}/lib/ftp/*.cpp
136+
${CMAKE_SOURCE_DIR}/lib/fuji/*.cpp
137+
${CMAKE_SOURCE_DIR}/lib/gpiox/*.cpp
138+
${CMAKE_SOURCE_DIR}/lib/hardware/*.cpp
139+
${CMAKE_SOURCE_DIR}/lib/http/*.cpp
140+
${CMAKE_SOURCE_DIR}/lib/meatloaf/*.cpp
141+
${CMAKE_SOURCE_DIR}/lib/media/*.cpp
142+
${CMAKE_SOURCE_DIR}/lib/media/**/*.cpp
143+
${CMAKE_SOURCE_DIR}/lib/modem-sniffer/*.cpp
144+
${CMAKE_SOURCE_DIR}/lib/network-protocol/*.cpp
145+
${CMAKE_SOURCE_DIR}/lib/printer-emulator/*.cpp
146+
${CMAKE_SOURCE_DIR}/lib/qrcode/*.c
147+
${CMAKE_SOURCE_DIR}/lib/qrcode/*.cpp
148+
${CMAKE_SOURCE_DIR}/lib/sam/*.c
149+
${CMAKE_SOURCE_DIR}/lib/sam/*.cpp
150+
${CMAKE_SOURCE_DIR}/lib/task/*.cpp
151+
${CMAKE_SOURCE_DIR}/lib/tcpip/*.cpp
152+
${CMAKE_SOURCE_DIR}/lib/telnet/*.c
153+
${CMAKE_SOURCE_DIR}/lib/tinyxml2/*.cpp
154+
${CMAKE_SOURCE_DIR}/lib/TNFSlib/*.cpp
155+
${CMAKE_SOURCE_DIR}/lib/utils/*.cpp
156+
${CMAKE_SOURCE_DIR}/lib/webdav/*.cpp
157+
)
158+
159+
idf_component_register(
160+
INCLUDE_DIRS ${INCLUDES}
161+
SRCS ${SOURCES}
162+
PRIV_REQUIRES esp_driver_uart esp_netif esp_driver_gpio fatfs vfs json esp_wifi mbedtls console app_update spi_flash mlff esp_driver_ledc expat http_parser esp-tls tcp_transport esp_driver_gptimer esp_driver_tsens esp_http_client libssh
163+
)
164+
165+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-value)
166+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-variable)
167+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-but-set-variable)
168+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-function)
169+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-parameter)
170+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-unused-const-variable)
171+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-return-type)
172+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-format-extra-args)
173+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough)
174+
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-missing-field-initializers)

0 commit comments

Comments
 (0)