touch_element: fix event callback parameter type, change it into pointer
This commit is contained in:
@@ -84,14 +84,14 @@ static void button_handler_task(void *arg)
|
||||
}
|
||||
#elif CONFIG_TOUCH_ELEM_CALLBACK
|
||||
/* Button callback routine */
|
||||
static void button_handler(touch_button_handle_t out_handle, touch_button_message_t out_message, void *arg)
|
||||
static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg)
|
||||
{
|
||||
(void) out_handle; //Unused
|
||||
if (out_message.event == TOUCH_BUTTON_EVT_ON_PRESS) {
|
||||
if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) {
|
||||
ESP_LOGI(TAG, "Button[%d] Press", (uint32_t)arg);
|
||||
} else if (out_message.event == TOUCH_BUTTON_EVT_ON_RELEASE) {
|
||||
} else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) {
|
||||
ESP_LOGI(TAG, "Button[%d] Release", (uint32_t)arg);
|
||||
} else if (out_message.event == TOUCH_BUTTON_EVT_ON_LONGPRESS) {
|
||||
} else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) {
|
||||
ESP_LOGI(TAG, "Button[%d] LongPress", (uint32_t)arg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,18 +76,18 @@ static void matrix_handler_task(void *arg)
|
||||
}
|
||||
#elif CONFIG_TOUCH_ELEM_CALLBACK
|
||||
/* Matrix callback routine */
|
||||
void matrix_handler(touch_matrix_handle_t out_handle, touch_matrix_message_t out_message, void *arg)
|
||||
void matrix_handler(touch_matrix_handle_t out_handle, touch_matrix_message_t *out_message, void *arg)
|
||||
{
|
||||
(void) arg; //Unused
|
||||
if (out_handle != matrix_handle) {
|
||||
return;
|
||||
}
|
||||
if (out_message.event == TOUCH_MATRIX_EVT_ON_PRESS) {
|
||||
ESP_LOGI(TAG, "Matrix Press, axis: (%d, %d) index: %d", out_message.position.x_axis, 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: (%d, %d) index: %d", out_message.position.x_axis, 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: (%d, %d) index: %d", out_message.position.x_axis, out_message.position.y_axis, out_message.position.index);
|
||||
if (out_message->event == TOUCH_MATRIX_EVT_ON_PRESS) {
|
||||
ESP_LOGI(TAG, "Matrix Press, axis: (%d, %d) index: %d", out_message->position.x_axis, 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: (%d, %d) index: %d", out_message->position.x_axis, 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: (%d, %d) index: %d", out_message->position.x_axis, out_message->position.y_axis, out_message->position.index);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -70,18 +70,18 @@ static void slider_handler_task(void *arg)
|
||||
}
|
||||
#elif CONFIG_TOUCH_ELEM_CALLBACK
|
||||
/* Slider callback routine */
|
||||
void slider_handler(touch_slider_handle_t out_handle, touch_slider_message_t out_message, void *arg)
|
||||
void slider_handler(touch_slider_handle_t out_handle, touch_slider_message_t *out_message, void *arg)
|
||||
{
|
||||
(void) arg; //Unused
|
||||
if (out_handle != slider_handle) {
|
||||
return;
|
||||
}
|
||||
if (out_message.event == TOUCH_SLIDER_EVT_ON_PRESS) {
|
||||
ESP_LOGI(TAG, "Slider Press, position: %d", out_message.position);
|
||||
} else if (out_message.event == TOUCH_SLIDER_EVT_ON_RELEASE) {
|
||||
ESP_LOGI(TAG, "Slider Release, position: %d", out_message.position);
|
||||
} else if (out_message.event == TOUCH_SLIDER_EVT_ON_CALCULATION) {
|
||||
ESP_LOGI(TAG, "Slider Calculate, position: %d", out_message.position);
|
||||
if (out_message->event == TOUCH_SLIDER_EVT_ON_PRESS) {
|
||||
ESP_LOGI(TAG, "Slider Press, position: %d", out_message->position);
|
||||
} else if (out_message->event == TOUCH_SLIDER_EVT_ON_RELEASE) {
|
||||
ESP_LOGI(TAG, "Slider Release, position: %d", out_message->position);
|
||||
} else if (out_message->event == TOUCH_SLIDER_EVT_ON_CALCULATION) {
|
||||
ESP_LOGI(TAG, "Slider Calculate, position: %d", out_message->position);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user