Skip to content

Commit

Permalink
Merge branch 'fix/esp_at_ready' into 'master'
Browse files Browse the repository at this point in the history
fix: Fixed the issue where at cannot work immediately after restart and prompt ready

See merge request application/esp-at!1514
  • Loading branch information
xcguang committed Jan 30, 2024
2 parents 8f09599 + 4bbfa04 commit 5591f3b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 24 deletions.
7 changes: 7 additions & 0 deletions components/at/src/at_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
const char *g_at_mfg_nvs_name = "mfg_nvs";

// static variables
static const char *s_ready_str = "\r\nready\r\n";
static at_mfg_params_storage_mode_t s_at_param_mode = AT_PARAMS_NONE;
static const char *TAG = "at-init";

Expand Down Expand Up @@ -266,6 +267,11 @@ static void at_nvs_flash_init_partition(void)
printf("at param mode: %d\r\n", s_at_param_mode);
}

static void esp_at_ready(void)
{
esp_at_port_active_write_data((uint8_t *)s_ready_str, strlen(s_ready_str));
}

void esp_at_init(void)
{
// initialize the manufacturing nvs partition
Expand Down Expand Up @@ -305,5 +311,6 @@ void esp_at_init(void)
at_cmd_set_terminator(CONFIG_AT_COMMAND_TERMINATOR);
#endif

esp_at_ready();
ESP_LOGD(TAG, "esp_at_init done");
}
7 changes: 0 additions & 7 deletions main/interface/at_interface_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "esp_at_core.h"

// static variables
static const char *s_ready_str = "\r\nready\r\n";
static esp_at_device_ops_struct s_interface_ops;
static esp_at_custom_ops_struct s_interface_hooks;
static const char *TAG = "at-intf";
Expand Down Expand Up @@ -133,9 +132,3 @@ void at_interface_hooks(esp_at_custom_ops_struct *if_hooks)
};
esp_at_custom_ops_regist(&at_hooks);
}

void esp_at_ready(void)
{
esp_at_port_active_write_data((uint8_t *)s_ready_str, strlen(s_ready_str));
ESP_LOGD(TAG, "AT interface ready");
}
5 changes: 0 additions & 5 deletions main/interface/include/esp_at_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,3 @@ void at_interface_ops_init(esp_at_device_ops_struct *ops);
* - not NULL: use the system-hooks and the interface-hooks.
*/
void at_interface_hooks(esp_at_custom_ops_struct *if_hooks);

/**
* @brief This function is used to notify MCU that the esp-at is ready.
*/
void esp_at_ready(void);
3 changes: 0 additions & 3 deletions main/interface/sdio/at_sdio_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ void at_interface_init(void)

// init interface hooks
at_interface_hooks(NULL);

// esp-at is ready
esp_at_ready();
}

#endif
3 changes: 0 additions & 3 deletions main/interface/socket/at_socket_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ void at_interface_init(void)
.pre_active_write_data_callback = NULL,
};
at_interface_hooks(&socket_hooks);

// interface ready
esp_at_ready();
}

#endif
3 changes: 0 additions & 3 deletions main/interface/spi/at_spi_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ void at_interface_init(void)

// init interface hooks
at_interface_hooks(NULL);

// interface ready
esp_at_ready();
}

#endif
3 changes: 0 additions & 3 deletions main/interface/uart/at_uart_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ void at_interface_init(void)
.pre_active_write_data_callback = NULL,
};
at_interface_hooks(&uart_hooks);

// interface ready
esp_at_ready();
}

#endif

0 comments on commit 5591f3b

Please sign in to comment.