mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Updated button idf_component to 2.3.0
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
static const char *TAG = "app_reset";
|
||||
static bool perform_factory_reset = false;
|
||||
|
||||
static void button_factory_reset_pressed_cb(void *arg)
|
||||
static void button_factory_reset_pressed_cb(void *arg, void *data)
|
||||
{
|
||||
if (!perform_factory_reset) {
|
||||
ESP_LOGI(TAG, "Factory reset triggered. Release the button to start factory reset.");
|
||||
@@ -25,7 +25,7 @@ static void button_factory_reset_pressed_cb(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
static void button_factory_reset_released_cb(void *arg)
|
||||
static void button_factory_reset_released_cb(void *arg, void *data)
|
||||
{
|
||||
if (perform_factory_reset) {
|
||||
ESP_LOGI(TAG, "Starting factory reset");
|
||||
@@ -42,7 +42,7 @@ esp_err_t app_reset_button_register(void *handle)
|
||||
}
|
||||
button_handle_t button_handle = (button_handle_t)handle;
|
||||
esp_err_t err = ESP_OK;
|
||||
err |= iot_button_register_cb(button_handle, BUTTON_LONG_PRESS_HOLD, button_factory_reset_pressed_cb);
|
||||
err |= iot_button_register_cb(button_handle, BUTTON_PRESS_UP, button_factory_reset_released_cb);
|
||||
err |= iot_button_register_cb(button_handle, BUTTON_LONG_PRESS_HOLD, button_factory_reset_pressed_cb, NULL);
|
||||
err |= iot_button_register_cb(button_handle, BUTTON_PRESS_UP, button_factory_reset_released_cb, NULL);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ static esp_err_t app_driver_light_set_temperature(led_driver_handle_t handle, es
|
||||
return led_driver_set_temperature(handle, value);
|
||||
}
|
||||
|
||||
static void app_driver_button_toggle_cb(void *arg)
|
||||
static void app_driver_button_toggle_cb(void *arg, void *data)
|
||||
{
|
||||
ESP_LOGI(TAG, "Toggle button pressed");
|
||||
uint16_t endpoint_id = light_endpoint_id;
|
||||
@@ -158,6 +158,6 @@ app_driver_handle_t app_driver_button_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);
|
||||
iot_button_register_cb(handle, BUTTON_PRESS_DOWN, app_driver_button_toggle_cb, NULL);
|
||||
return (app_driver_handle_t)handle;
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ void app_driver_client_group_command_callback(uint8_t fabric_index, client::comm
|
||||
}
|
||||
}
|
||||
|
||||
static void app_driver_button_toggle_cb(void *arg)
|
||||
static void app_driver_button_toggle_cb(void *arg, void *data)
|
||||
{
|
||||
ESP_LOGI(TAG, "Toggle button pressed");
|
||||
client::command_handle_t cmd_handle;
|
||||
@@ -581,7 +581,7 @@ 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);
|
||||
iot_button_register_cb(handle, BUTTON_PRESS_DOWN, app_driver_button_toggle_cb, NULL);
|
||||
|
||||
/* Other initializations */
|
||||
#if CONFIG_ENABLE_CHIP_SHELL
|
||||
|
||||
@@ -54,7 +54,7 @@ static esp_err_t app_driver_light_set_temperature(led_driver_handle_t handle, es
|
||||
return led_driver_set_temperature(handle, value);
|
||||
}
|
||||
|
||||
static void app_driver_button_toggle_cb(void *arg)
|
||||
static void app_driver_button_toggle_cb(void *arg, void *data)
|
||||
{
|
||||
ESP_LOGI(TAG, "Toggle button pressed");
|
||||
uint16_t endpoint_id = light_endpoint_id;
|
||||
@@ -163,6 +163,6 @@ app_driver_handle_t app_driver_button_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);
|
||||
iot_button_register_cb(handle, BUTTON_PRESS_DOWN, app_driver_button_toggle_cb, NULL);
|
||||
return (app_driver_handle_t)handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user