diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0f0d740..080e70d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,10 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ] -} +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ], + "unwantedRecommendations": [ + "ms-vscode.cpptools-extension-pack" + ] +} diff --git a/src/event.hpp b/src/event.hpp index 535a590..6c6642b 100644 --- a/src/event.hpp +++ b/src/event.hpp @@ -119,33 +119,17 @@ inline void stop_timer(esp_timer_handle_t timer) #define TOUCH_TAG "TOUCH" -#define check_touch_begin(t, st) \ - if (t.state == st) \ - { \ - ESP_LOGI(TOUCH_TAG, "Touch event " #st ": %d (%d,%d)", t.state, t.x, t.y); \ - esp_event_post_to(loop_handle, TOUCH_EVENT, TOUCH_EVENT_TOUCH_BEGIN, &t, sizeof(t), 0); \ +#define check_touch_hold_flick(t, st, event_id) \ + if (t.state == st) \ + { \ + ESP_LOGI(TOUCH_TAG, "Touch event " #st ": %d (%d,%d)", t.state, t.x, t.y); \ + esp_event_post_to(loop_handle, TOUCH_EVENT, event_id, &t, sizeof(t), 0); \ } -#define check_hold_begin(t, st) \ - if (t.state == st) \ - { \ - ESP_LOGI(TOUCH_TAG, "Touch event " #st ": %d (%d,%d)", t.state, t.x, t.y); \ - esp_event_post_to(loop_handle, TOUCH_EVENT, TOUCH_EVENT_HOLD_BEGIN, &t, sizeof(t), 0); \ - } - -#define check_touch_end(t, st) \ - if (t.state == st) \ - { \ - ESP_LOGI(TOUCH_TAG, "Touch event " #st ": %d (%d,%d)", t.state, t.x, t.y); \ - esp_event_post_to(loop_handle, TOUCH_EVENT, TOUCH_EVENT_TOUCH_END, &t, sizeof(t), 0); \ - } - -#define check_flick_end(t, st) \ - if (t.state == st) \ - { \ - ESP_LOGI(TOUCH_TAG, "Touch event " #st ": %d (%d,%d)", t.state, t.x, t.y); \ - esp_event_post_to(loop_handle, TOUCH_EVENT, TOUCH_EVENT_FLICK_END, &t, sizeof(t), 0); \ - } +#define check_touch_begin(t, st) check_touch_hold_flick(t, st, TOUCH_EVENT_TOUCH_BEGIN) +#define check_hold_begin(t, st) check_touch_hold_flick(t, st, TOUCH_EVENT_HOLD_BEGIN) +#define check_touch_end(t, st) check_touch_hold_flick(t, st, TOUCH_EVENT_TOUCH_END) +#define check_flick_end(t, st) check_touch_hold_flick(t, st, TOUCH_EVENT_FLICK_END) inline void update_device_event() {