mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-02 15:23:21 +00:00
build and link hello-world for esp32s2beta
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
#include "esp_event.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_private/wifi.h"
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "esp_eth.h"
|
||||
#endif
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
@@ -41,7 +43,7 @@ static void handle_sta_stop(void *arg, esp_event_base_t base, int32_t event_id,
|
||||
static void handle_sta_connected(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
static void handle_sta_disconnected(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
static void handle_sta_got_ip(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
static void handle_eth_start(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
static void handle_eth_stop(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
static void handle_eth_connected(void *arg, esp_event_base_t base, int32_t event_id, void *data);
|
||||
@@ -97,6 +99,16 @@ static void handle_eth_disconnected(void *arg, esp_event_base_t base, int32_t ev
|
||||
tcpip_adapter_down(TCPIP_ADAPTER_IF_ETH);
|
||||
}
|
||||
|
||||
static void handle_eth_got_ip(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
const ip_event_got_ip_t *event = (const ip_event_got_ip_t *) data;
|
||||
ESP_LOGI(TAG, "eth ip: " IPSTR ", mask: " IPSTR ", gw: " IPSTR,
|
||||
IP2STR(&event->ip_info.ip),
|
||||
IP2STR(&event->ip_info.netmask),
|
||||
IP2STR(&event->ip_info.gw));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void handle_sta_got_ip(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
API_CALL_CHECK("esp_wifi_internal_set_sta_ip", esp_wifi_internal_set_sta_ip(), ESP_OK);
|
||||
@@ -108,14 +120,6 @@ static void handle_sta_got_ip(void *arg, esp_event_base_t base, int32_t event_id
|
||||
IP2STR(&event->ip_info.gw));
|
||||
}
|
||||
|
||||
static void handle_eth_got_ip(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
const ip_event_got_ip_t *event = (const ip_event_got_ip_t *) data;
|
||||
ESP_LOGI(TAG, "eth ip: " IPSTR ", mask: " IPSTR ", gw: " IPSTR,
|
||||
IP2STR(&event->ip_info.ip),
|
||||
IP2STR(&event->ip_info.netmask),
|
||||
IP2STR(&event->ip_info.gw));
|
||||
}
|
||||
|
||||
static void handle_ap_start(void *arg, esp_event_base_t base, int32_t event_id, void *data)
|
||||
{
|
||||
@@ -261,7 +265,7 @@ esp_err_t tcpip_adapter_clear_default_wifi_handlers()
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
esp_err_t tcpip_adapter_set_default_eth_handlers()
|
||||
{
|
||||
esp_err_t err;
|
||||
@@ -306,3 +310,4 @@ esp_err_t tcpip_adapter_clear_default_eth_handlers()
|
||||
esp_event_handler_unregister(IP_EVENT, IP_EVENT_ETH_GOT_IP, handle_eth_got_ip);
|
||||
return ESP_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user