Skip to content

Commit 82a784b

Browse files
authored
Merge pull request #880 from david-cermak/fix/modem_ci
[modem]: Fix recent CI issues
2 parents b7cfa31 + 15140e0 commit 82a784b

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

components/esp_modem/examples/modem_console/main/console_helper.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,12 @@ void ConsoleCommand::RegisterCommand(const char *command, const char *help, cons
6363

6464
arg_type end = { .end = arg_end(1) };
6565
arg_table.emplace_back(end);
66-
const esp_console_cmd_t command_def = {
67-
.command = command,
68-
.help = help,
69-
.hint = nullptr,
70-
.func = command_func_pts[last_command],
71-
.argtable = &arg_table[0]
72-
};
66+
esp_console_cmd_t command_def = { };
67+
command_def.command = command;
68+
command_def.help = help;
69+
command_def.hint = nullptr;
70+
command_def.func = command_func_pts[last_command];
71+
command_def.argtable = &arg_table[0];
7372
ESP_ERROR_CHECK(esp_console_cmd_register(&command_def));
7473
last_command++;
7574
console_commands.emplace_back(this);

components/esp_modem/examples/modem_console/main/modem_console_main.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "cxx_include/esp_modem_dte.hpp"
2222
#include "esp_modem_config.h"
2323
#include "cxx_include/esp_modem_api.hpp"
24+
#include "esp_idf_version.h"
2425
#if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB)
2526
#include "esp_modem_usb_config.h"
2627
#include "cxx_include/esp_modem_usb_api.hpp"
@@ -29,6 +30,12 @@
2930
#include "console_helper.hpp"
3031
#include "my_module_dce.hpp"
3132

33+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
34+
#define GET_WAKEUP_CAUSE() esp_sleep_get_wakeup_causes()
35+
#else
36+
#define GET_WAKEUP_CAUSE() esp_sleep_get_wakeup_cause()
37+
#endif
38+
3239
#if defined(CONFIG_EXAMPLE_FLOW_CONTROL_NONE)
3340
#define EXAMPLE_FLOW_CONTROL ESP_MODEM_FLOW_CONTROL_NONE
3441
#elif defined(CONFIG_EXAMPLE_FLOW_CONTROL_SW)
@@ -208,7 +215,7 @@ extern "C" void app_main(void)
208215
esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
209216
ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &s_repl));
210217

211-
switch (esp_sleep_get_wakeup_cause()) {
218+
switch (GET_WAKEUP_CAUSE()) {
212219
case ESP_SLEEP_WAKEUP_TIMER:
213220
if (esp_modem::modem_mode::CMUX_MODE == mode_rtc) {
214221
ESP_LOGI(TAG, "Deep sleep reset\n");
@@ -428,7 +435,7 @@ extern "C" void app_main(void)
428435
const ConsoleCommand SetDeepSleep("set_deep_sleep", "Put esp32 to deep sleep", &deep_sleep_args, sizeof(deep_sleep_args), [&](ConsoleCommand * c) {
429436
int tout = c->get_int_of(&DeepSleepArgs::timeout);
430437
ESP_LOGI(TAG, "Entering deep sleep for %d sec", tout);
431-
ESP_LOGI(TAG, "Wakeup Cause: %d ", esp_sleep_get_wakeup_cause());
438+
ESP_LOGI(TAG, "Wakeup Cause: %d ", GET_WAKEUP_CAUSE());
432439
esp_deep_sleep(tout * 1000000);
433440
return 0;
434441
});

components/esp_modem/test/target_ota/main/ota_test.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414
#include "cxx_include/esp_modem_dte.hpp"
1515
#include "esp_modem_config.h"
1616
#include "cxx_include/esp_modem_api.hpp"
17-
#include "esp_vfs_dev.h" // For optional VFS support
18-
#include "vfs_resource/vfs_create.hpp"
17+
#include "esp_idf_version.h"
1918
#include "network_dce.hpp"
2019
#include "manual_ota.hpp"
2120
#include "mqtt_client.h"
21+
// For optional VFS support
22+
#include "vfs_resource/vfs_create.hpp"
23+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
24+
#include "driver/uart_vfs.h"
25+
#else
26+
#include "esp_vfs_dev.h"
27+
#endif
2228

2329
using namespace esp_modem;
2430

@@ -189,7 +195,12 @@ extern "C" void app_main(void)
189195
assert(vfs_create_uart(&uart_config, &dte_config.vfs_config) == true);
190196

191197
auto dte = create_vfs_dte(&dte_config);
198+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
199+
uart_vfs_dev_use_driver(uart_config.uart.port_num);
200+
#else
192201
esp_vfs_dev_uart_use_driver(uart_config.uart.port_num);
202+
#endif
203+
193204
#else
194205
auto dte = create_uart_dte(&dte_config);
195206
#endif // CONFIG_TEST_USE_VFS_TERM

0 commit comments

Comments
 (0)