diff options
author | Skorpionm <85568270+Skorpionm@users.noreply.github.com> | 2021-09-02 00:05:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 00:05:00 +0300 |
commit | e17336498db48de0898313aca9099985b91bd89e (patch) | |
tree | 2ad1fedde8432714b1fa230c23f913d29b8ba494 /applications/input | |
parent | 3ed26e61eb75f715f4b46e6104c9b49057159594 (diff) |
[FL-1756, FL-1769, FL-1776, FL-1759] Gui: input events complementary V3, refactoring. SubGhz: read/emulate fixes. Cleanup. (#684)
* Gui: move rotation logic to ViewPort, replace delayed View switch in ViewDispatcher with event filtering and redirection to previous view.
* SubGhz: add function description
* Gui, Input: add event id to input events.
* SubGhz: fix "crashing on ?"
* SubGhz: add icon scanning
* SubGhz: updated interface read scene, updated interface config scene
* Assets: update subghz assets
* SubGhz: replaced the picture in the read scene, changed the paths to additional files
* SubGhz: fix deadlock in timer callback
* SubGhz: fix icon read scene
* SubGhz: fix icon read scene
* SubGhz: fix duble text transmitter scene
* SubGhz: correct spelling. Gui: bigger queue for ViewDispatcher.
* SubGhz: fix creation and transmission of dynamic code without the presence of a manufactory key
* SubGhz: fix keelog, setting a name in the absence of a manufactory key
* SubGhz: fix load bad keelog key
* Format sources
* Furi: remove garbage from core. GpioTester: fix memory leak and cleanup
* Accessor: remove obsolete notification code
* MusicPlayer: remove input event injection
* Input: rename id to sequence
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Diffstat (limited to 'applications/input')
-rw-r--r-- | applications/input/input.c | 5 | ||||
-rw-r--r-- | applications/input/input.h | 1 | ||||
-rw-r--r-- | applications/input/input_i.h | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/applications/input/input.c b/applications/input/input.c index 4dd4df43..62be3dba 100644 --- a/applications/input/input.c +++ b/applications/input/input.c @@ -23,6 +23,7 @@ inline static void input_timer_stop(osTimerId_t timer_id) { void input_press_timer_callback(void* arg) { InputPinState* input_pin = arg; InputEvent event; + event.sequence = input_pin->counter; event.key = input_pin->pin->key; input_pin->press_counter++; if(input_pin->press_counter == INPUT_LONG_PRESS_COUNTS) { @@ -158,8 +159,12 @@ int32_t input_srv() { // Short / Long / Repeat timer routine if(state) { + input->counter++; + input->pin_states[i].counter = input->counter; + event.sequence = input->pin_states[i].counter; input_timer_start(input->pin_states[i].press_timer, INPUT_PRESS_TICKS); } else { + event.sequence = input->pin_states[i].counter; input_timer_stop(input->pin_states[i].press_timer); if(input->pin_states[i].press_counter < INPUT_LONG_PRESS_COUNTS) { event.type = InputTypeShort; diff --git a/applications/input/input.h b/applications/input/input.h index 228eaaf5..fd6da95d 100644 --- a/applications/input/input.h +++ b/applications/input/input.h @@ -15,6 +15,7 @@ typedef enum { /* Input Event, dispatches with PubSub */ typedef struct { + uint32_t sequence; InputKey key; InputType type; } InputEvent; diff --git a/applications/input/input_i.h b/applications/input/input_i.h index a0f6cfc3..d0cdfa76 100644 --- a/applications/input/input_i.h +++ b/applications/input/input_i.h @@ -24,6 +24,7 @@ typedef struct { volatile uint8_t debounce; volatile osTimerId_t press_timer; volatile uint8_t press_counter; + volatile uint32_t counter; } InputPinState; /* Input state */ @@ -32,6 +33,7 @@ typedef struct { PubSub event_pubsub; InputPinState* pin_states; Cli* cli; + volatile uint32_t counter; } Input; /* Input press timer callback */ |