mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-09-25 14:20:54 +02:00
Merge pull request #880 from david-cermak/fix/modem_ci
[modem]: Fix recent CI issues
This commit is contained in:
@@ -63,13 +63,12 @@ void ConsoleCommand::RegisterCommand(const char *command, const char *help, cons
|
|||||||
|
|
||||||
arg_type end = { .end = arg_end(1) };
|
arg_type end = { .end = arg_end(1) };
|
||||||
arg_table.emplace_back(end);
|
arg_table.emplace_back(end);
|
||||||
const esp_console_cmd_t command_def = {
|
esp_console_cmd_t command_def = { };
|
||||||
.command = command,
|
command_def.command = command;
|
||||||
.help = help,
|
command_def.help = help;
|
||||||
.hint = nullptr,
|
command_def.hint = nullptr;
|
||||||
.func = command_func_pts[last_command],
|
command_def.func = command_func_pts[last_command];
|
||||||
.argtable = &arg_table[0]
|
command_def.argtable = &arg_table[0];
|
||||||
};
|
|
||||||
ESP_ERROR_CHECK(esp_console_cmd_register(&command_def));
|
ESP_ERROR_CHECK(esp_console_cmd_register(&command_def));
|
||||||
last_command++;
|
last_command++;
|
||||||
console_commands.emplace_back(this);
|
console_commands.emplace_back(this);
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include "cxx_include/esp_modem_dte.hpp"
|
#include "cxx_include/esp_modem_dte.hpp"
|
||||||
#include "esp_modem_config.h"
|
#include "esp_modem_config.h"
|
||||||
#include "cxx_include/esp_modem_api.hpp"
|
#include "cxx_include/esp_modem_api.hpp"
|
||||||
|
#include "esp_idf_version.h"
|
||||||
#if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB)
|
#if defined(CONFIG_EXAMPLE_SERIAL_CONFIG_USB)
|
||||||
#include "esp_modem_usb_config.h"
|
#include "esp_modem_usb_config.h"
|
||||||
#include "cxx_include/esp_modem_usb_api.hpp"
|
#include "cxx_include/esp_modem_usb_api.hpp"
|
||||||
@@ -29,6 +30,12 @@
|
|||||||
#include "console_helper.hpp"
|
#include "console_helper.hpp"
|
||||||
#include "my_module_dce.hpp"
|
#include "my_module_dce.hpp"
|
||||||
|
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
|
||||||
|
#define GET_WAKEUP_CAUSE() esp_sleep_get_wakeup_causes()
|
||||||
|
#else
|
||||||
|
#define GET_WAKEUP_CAUSE() esp_sleep_get_wakeup_cause()
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_EXAMPLE_FLOW_CONTROL_NONE)
|
#if defined(CONFIG_EXAMPLE_FLOW_CONTROL_NONE)
|
||||||
#define EXAMPLE_FLOW_CONTROL ESP_MODEM_FLOW_CONTROL_NONE
|
#define EXAMPLE_FLOW_CONTROL ESP_MODEM_FLOW_CONTROL_NONE
|
||||||
#elif defined(CONFIG_EXAMPLE_FLOW_CONTROL_SW)
|
#elif defined(CONFIG_EXAMPLE_FLOW_CONTROL_SW)
|
||||||
@@ -208,7 +215,7 @@ extern "C" void app_main(void)
|
|||||||
esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
|
esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
|
||||||
ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &s_repl));
|
ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &s_repl));
|
||||||
|
|
||||||
switch (esp_sleep_get_wakeup_cause()) {
|
switch (GET_WAKEUP_CAUSE()) {
|
||||||
case ESP_SLEEP_WAKEUP_TIMER:
|
case ESP_SLEEP_WAKEUP_TIMER:
|
||||||
if (esp_modem::modem_mode::CMUX_MODE == mode_rtc) {
|
if (esp_modem::modem_mode::CMUX_MODE == mode_rtc) {
|
||||||
ESP_LOGI(TAG, "Deep sleep reset\n");
|
ESP_LOGI(TAG, "Deep sleep reset\n");
|
||||||
@@ -428,7 +435,7 @@ extern "C" void app_main(void)
|
|||||||
const ConsoleCommand SetDeepSleep("set_deep_sleep", "Put esp32 to deep sleep", &deep_sleep_args, sizeof(deep_sleep_args), [&](ConsoleCommand * c) {
|
const ConsoleCommand SetDeepSleep("set_deep_sleep", "Put esp32 to deep sleep", &deep_sleep_args, sizeof(deep_sleep_args), [&](ConsoleCommand * c) {
|
||||||
int tout = c->get_int_of(&DeepSleepArgs::timeout);
|
int tout = c->get_int_of(&DeepSleepArgs::timeout);
|
||||||
ESP_LOGI(TAG, "Entering deep sleep for %d sec", tout);
|
ESP_LOGI(TAG, "Entering deep sleep for %d sec", tout);
|
||||||
ESP_LOGI(TAG, "Wakeup Cause: %d ", esp_sleep_get_wakeup_cause());
|
ESP_LOGI(TAG, "Wakeup Cause: %d ", GET_WAKEUP_CAUSE());
|
||||||
esp_deep_sleep(tout * 1000000);
|
esp_deep_sleep(tout * 1000000);
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
@@ -14,11 +14,17 @@
|
|||||||
#include "cxx_include/esp_modem_dte.hpp"
|
#include "cxx_include/esp_modem_dte.hpp"
|
||||||
#include "esp_modem_config.h"
|
#include "esp_modem_config.h"
|
||||||
#include "cxx_include/esp_modem_api.hpp"
|
#include "cxx_include/esp_modem_api.hpp"
|
||||||
#include "esp_vfs_dev.h" // For optional VFS support
|
#include "esp_idf_version.h"
|
||||||
#include "vfs_resource/vfs_create.hpp"
|
|
||||||
#include "network_dce.hpp"
|
#include "network_dce.hpp"
|
||||||
#include "manual_ota.hpp"
|
#include "manual_ota.hpp"
|
||||||
#include "mqtt_client.h"
|
#include "mqtt_client.h"
|
||||||
|
// For optional VFS support
|
||||||
|
#include "vfs_resource/vfs_create.hpp"
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
|
||||||
|
#include "driver/uart_vfs.h"
|
||||||
|
#else
|
||||||
|
#include "esp_vfs_dev.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace esp_modem;
|
using namespace esp_modem;
|
||||||
|
|
||||||
@@ -189,7 +195,12 @@ extern "C" void app_main(void)
|
|||||||
assert(vfs_create_uart(&uart_config, &dte_config.vfs_config) == true);
|
assert(vfs_create_uart(&uart_config, &dte_config.vfs_config) == true);
|
||||||
|
|
||||||
auto dte = create_vfs_dte(&dte_config);
|
auto dte = create_vfs_dte(&dte_config);
|
||||||
|
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
|
||||||
|
uart_vfs_dev_use_driver(uart_config.uart.port_num);
|
||||||
|
#else
|
||||||
esp_vfs_dev_uart_use_driver(uart_config.uart.port_num);
|
esp_vfs_dev_uart_use_driver(uart_config.uart.port_num);
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
auto dte = create_uart_dte(&dte_config);
|
auto dte = create_uart_dte(&dte_config);
|
||||||
#endif // CONFIG_TEST_USE_VFS_TERM
|
#endif // CONFIG_TEST_USE_VFS_TERM
|
||||||
|
Reference in New Issue
Block a user