Skip to content

Commit d1d5a8b

Browse files
authored
feat(cli): Update to no longer require exception support (#519)
* feat(cli): Update to no longer require exception support * fix drv and iperf menu examples * minor update to cli component to reduce overhead when packaging * minor update
1 parent ea72ef6 commit d1d5a8b

31 files changed

+30
-127
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,9 @@ jobs:
9595
- path: 'components/i2c/example'
9696
target: esp32
9797
command: idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.legacy_api" build
98-
- path: 'components/i2c/example'
99-
target: esp32
100-
command: idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.legacy_api;sdkconfig.defaults.cli" build
10198
- path: 'components/i2c/example'
10299
target: esp32
103100
command: idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.new_api" build
104-
- path: 'components/i2c/example'
105-
target: esp32
106-
command: idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.new_api;sdkconfig.defaults.cli;" build
107101

108102
- path: 'components/icm20948/example'
109103
target: esp32s3

components/binary-log/example/sdkconfig.defaults

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ CONFIG_IDF_TARGET="esp32s3"
22

33
# Common ESP-related
44
#
5-
# binary_log requires exceptions right now...
6-
# CONFIG_COMPILER_CXX_EXCEPTIONS=y
7-
85
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
96
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
107

components/ble_gatt_server/example/main/ble_gatt_server_example.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ extern "C" void app_main(void) {
105105
adv_data.addTxPower();
106106
ble_gatt_server.set_advertisement_data(adv_data);
107107

108-
#if CONFIG_COMPILER_CXX_EXCEPTIONS
109108
// let's test and use the BLE menu (CLI)
110109
// turn off some of the logs so that it doesn't clutter up the CLI
111110
ble_gatt_server.set_log_level(espp::Logger::Verbosity::WARN);
@@ -118,7 +117,6 @@ extern "C" void app_main(void) {
118117
espp::Cli input(cli);
119118
input.SetInputHistorySize(10);
120119
input.Start(); // this will not return until the user enters the `exit` command.
121-
#endif
122120

123121
logger.info("Menu has finished, starting advertising");
124122
// The menu has finished, so let's go into a loop to keep the device running

components/ble_gatt_server/example/sdkconfig.defaults

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192
3636

3737
# Set the ESP-NIMBLE-CPP Config
3838
CONFIG_NIMBLE_CPP_LOG_LEVEL_NONE=y
39-
40-
# the cli library requires exceptions right now...
41-
CONFIG_COMPILER_CXX_EXCEPTIONS=y

components/ble_gatt_server/include/ble_gatt_server_menu.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <sdkconfig.h>
44

5-
#if CONFIG_COMPILER_CXX_EXCEPTIONS || defined(_DOXYGEN_)
65
#if CONFIG_BT_NIMBLE_ENABLED || defined(_DOXYGEN_)
76

87
#include <functional>
@@ -400,4 +399,3 @@ class BleGattServerMenu {
400399
} // namespace espp
401400

402401
#endif // CONFIG_BT_NIMBLE_ENABLED || defined(_DOXYGEN_)
403-
#endif // CONFIG_COMPILER_CXX_EXCEPTIONS || defined(_DOXYGEN_)

components/cli/CMakeLists.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
set(CLI_INCLUDES "include")
2-
3-
if (CONFIG_COMPILER_CXX_EXCEPTIONS)
4-
list(APPEND CLI_INCLUDES "detail/cli/include")
5-
else()
6-
message(WARNING "C++ exceptions are disabled, CLI is disabled")
7-
endif()
8-
91
idf_component_register(
10-
INCLUDE_DIRS ${CLI_INCLUDES}
2+
INCLUDE_DIRS "include" "detail/cli/include"
113
SRC_DIRS "src"
124
REQUIRES driver esp_driver_uart esp_driver_usb_serial_jtag vfs logger)

components/cli/detail/cli

Submodule cli updated 50 files

components/cli/example/main/cli_example.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ extern "C" void app_main(void) {
1818
"hello_everysession",
1919
[](std::ostream &) { cli::Cli::cout() << "Hello everybody" << std::endl; },
2020
"Print hello everybody on all open sessions");
21+
root_menu->Insert(
22+
"add", [](std::ostream &out, float x, float y) { out << (x + y) << "\n"; },
23+
"Add two numbers");
2124
root_menu->Insert(
2225
"answer", [](std::ostream &out, int x) { out << "The answer is: " << x << "\n"; },
2326
"Print the answer to Life, the Universe and Everything ");

components/cli/example/sdkconfig.defaults

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
#
33
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=4096
44
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
5-
6-
# the cli library requires exceptions right now...
7-
CONFIG_COMPILER_CXX_EXCEPTIONS=y

components/cli/idf_component.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ tags:
1414
- Command-Line
1515
- CLI
1616
- Input
17+
files:
18+
exclude:
19+
- "detail/cli/**/*" # exclude everything in the cli repo
20+
include:
21+
- "detail/cli/include/**/*" # explicitly only include the include folder
1722
dependencies:
1823
idf:
1924
version: '>=5.0'

0 commit comments

Comments
 (0)