Configurability of esp-matter examples (how get configured GPIO for button?)
Posted: Mon Apr 03, 2023 1:16 pm
I'm just trying out the button example for esp-matter. I wanted to check which PIN was connected but unfortunately I couldn't figure it out from the source code. The below mentioned app_driver_switch_init() function which supposedly inits the button will pull in the configuration via a call to button_driver_get_config() yet this function is nowhere to be found. I only found some references in the linker scripts and it seemsthat it is linked in statically.
-- app_driver.cpp --
-- light_switch.map --
--> Links to libdevice.a
--> Is this the value?
Sorry I'm not really adept in linker scripts, please enlighten me if you know more In any case, this would make it very inconvenient to configure for the end user. Am I missing something?
-- app_driver.cpp --
Code: Select all
app_driver_handle_t app_driver_switch_init()
{
/* Initialize button */
button_config_t config = button_driver_get_config();
button_handle_t handle = iot_button_create(&config);
iot_button_register_cb(handle, BUTTON_PRESS_DOWN, app_driver_button_toggle_cb, NULL);
/* Other initializations */
#if CONFIG_ENABLE_CHIP_SHELL
app_driver_register_commands();
#endif // CONFIG_ENABLE_CHIP_SHELL
client::set_command_callback(app_driver_client_command_callback, app_driver_client_group_command_callback, NULL);
return (app_driver_handle_t)handle;
}
Code: Select all
button_driver_get_config esp-idf/device/libdevice.a(device.c.obj)
esp-idf/main/libmain.a(app_driver.cpp.obj)
Code: Select all
.literal.button_driver_get_config
0x00000000400d0804 0x0 esp-idf/device/libdevice.a(device.c.obj)
0x4 (size before relaxing)
Sorry I'm not really adept in linker scripts, please enlighten me if you know more In any case, this would make it very inconvenient to configure for the end user. Am I missing something?