Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ if(CONFIG_ESP_HOSTED_ENABLED)

# host ESP32 specific files
list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_ota.c")

list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_gpio.c")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the co-processor, a compilation define can be added on the host side to only compile GPIO related code if needed.

Add this to the top level Kconfig, below config ESP_HOSTED_ENABLE_ITWT:

	config ESP_HOSTED_ENABLE_GPIO_CONTROL
		bool "Enable GPIO control on co-processor"
		default n
		help
			Enable RPC methods that allow the HOST MCU to configure and control GPIOs
			on the co-processor. Leave disabled unless you really need it.
			GPIO requests that target pins used by the active transport will be rejected.

This is then used to enable code compilation of the GPIO code:

  1. Modify CMakeLists.txt to conditionally compile GPIO related code:
	if(CONFIG_ESP_HOSTED_ENABLE_GPIO_CONTROL)
		list(APPEND srcs "${host_dir}/port/esp/freertos/src/port_esp_hosted_host_gpio.c")
    endif()
  1. Add a config option at the bottom of host/port/esp/freertos/include/port_esp_hosted_host_config.h:
#if CONFIG_ESP_HOSTED_ENABLE_GPIO_CONTROL
#define H_ENABLE_GPIO_CONTROL 1
#else
#define H_ENABLE_GPIO_CONTROL 0
#endif
  1. Surround GPIO related code with #if H_ENABLE_GPIO_CONTROL ... #endif

# cli
list(APPEND srcs "${common_dir}/utils/esp_hosted_cli.c")
list(APPEND priv_include "${common_dir}/utils")
Expand Down
10,633 changes: 6,128 additions & 4,505 deletions common/proto/esp_hosted_rpc.pb-c.c

Large diffs are not rendered by default.

Loading