refactor(examples): reformat peripheral examples with astyle_py

This commit is contained in:
morris
2023-09-28 09:43:12 +08:00
parent 1b2484214c
commit b12e250b2c
79 changed files with 677 additions and 703 deletions
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/
@@ -60,13 +60,13 @@ static void matrix_handler_task(void *arg)
const touch_matrix_message_t *matrix_message = touch_matrix_get_message(&element_message);
if (matrix_message->event == TOUCH_MATRIX_EVT_ON_PRESS) {
ESP_LOGI(TAG, "Matrix Press, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, matrix_message->position.x_axis,
matrix_message->position.y_axis, matrix_message->position.index);
matrix_message->position.y_axis, matrix_message->position.index);
} else if (matrix_message->event == TOUCH_MATRIX_EVT_ON_RELEASE) {
ESP_LOGI(TAG, "Matrix Release, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, matrix_message->position.x_axis,
matrix_message->position.y_axis, matrix_message->position.index);
matrix_message->position.y_axis, matrix_message->position.index);
} else if (matrix_message->event == TOUCH_MATRIX_EVT_ON_LONGPRESS) {
ESP_LOGI(TAG, "Matrix LongPress, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, matrix_message->position.x_axis,
matrix_message->position.y_axis, matrix_message->position.index);
matrix_message->position.y_axis, matrix_message->position.index);
}
}
}
@@ -80,13 +80,13 @@ void matrix_handler(touch_matrix_handle_t out_handle, touch_matrix_message_t *ou
}
if (out_message->event == TOUCH_MATRIX_EVT_ON_PRESS) {
ESP_LOGI(TAG, "Matrix Press, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, out_message->position.x_axis,
out_message->position.y_axis, out_message->position.index);
out_message->position.y_axis, out_message->position.index);
} else if (out_message->event == TOUCH_MATRIX_EVT_ON_RELEASE) {
ESP_LOGI(TAG, "Matrix Release, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, out_message->position.x_axis,
out_message->position.y_axis, out_message->position.index);
out_message->position.y_axis, out_message->position.index);
} else if (out_message->event == TOUCH_MATRIX_EVT_ON_LONGPRESS) {
ESP_LOGI(TAG, "Matrix LongPress, axis: (%"PRIu8", %"PRIu8") index: %"PRIu8, out_message->position.x_axis,
out_message->position.y_axis, out_message->position.index);
out_message->position.y_axis, out_message->position.index);
}
}
#endif
@@ -113,7 +113,7 @@ void app_main(void)
ESP_ERROR_CHECK(touch_matrix_create(&matrix_config, &matrix_handle));
/* Subscribe touch matrix events (On Press, On Release, On LongPress) */
ESP_ERROR_CHECK(touch_matrix_subscribe_event(matrix_handle,
TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, NULL));
TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, NULL));
#ifdef CONFIG_TOUCH_ELEM_EVENT
/* Set EVENT as the dispatch method */
ESP_ERROR_CHECK(touch_matrix_set_dispatch_method(matrix_handle, TOUCH_ELEM_DISP_EVENT));