esp_http_client: remove dependency of esp_stubs from esp_http_client. Add esp_event stubs in linux component

This commit is contained in:
Harshit Malpani 2023-03-13 10:43:34 +05:30
parent 674fd8feb8
commit 0cc243a8cc
No known key found for this signature in database
GPG Key ID: FF1193D150EF75C3
5 changed files with 21 additions and 22 deletions

View File

@ -1,7 +1,7 @@
if(NOT ${IDF_TARGET} STREQUAL "linux")
set(req lwip esp_event)
else()
set(req esp_stubs)
set(req linux)
endif()
idf_component_register(SRCS "esp_http_client.c"

View File

@ -3,5 +3,6 @@ if(NOT "${target}" STREQUAL "linux")
return()
endif()
idf_component_register(INCLUDE_DIRS include
idf_component_register(SRCS esp_event_stubs.c
INCLUDE_DIRS include ${IDF_PATH}/components/esp_event/include
REQUIRED_IDF_TARGETS linux)

View File

@ -0,0 +1,18 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_err.h"
#include "esp_event.h"
esp_err_t esp_event_loop_create_default(void)
{
return ESP_OK;
}
esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id,
const void* event_data, size_t event_data_size, TickType_t ticks_to_wait)
{
return ESP_OK;
}

View File

@ -10,17 +10,6 @@
extern void app_main(void);
esp_err_t esp_event_loop_create_default(void)
{
return ESP_OK;
}
esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id,
const void* event_data, size_t event_data_size, TickType_t ticks_to_wait)
{
return ESP_OK;
}
esp_err_t esp_netif_init(void)
{
return ESP_OK;

View File

@ -5,13 +5,4 @@
*/
#include "esp_err.h"
typedef const char* esp_event_base_t; /**< unique pointer to a subsystem that exposes events */
typedef unsigned long TickType_t;
#define ESP_EVENT_DECLARE_BASE(id) extern esp_event_base_t id
#define ESP_EVENT_DEFINE_BASE(id) esp_event_base_t id = #id
esp_err_t esp_event_loop_create_default(void);
esp_err_t esp_event_post(esp_event_base_t event_base, int32_t event_id,
const void* event_data, size_t event_data_size, TickType_t ticks_to_wait);