Input handling and debouncing (#148)

* Add input driver and definitions for target_f2

* Add input_dump example

* Invert charge input

* Fix back and left button configuration

* remove input debug

* input testing case

* move header

* lint code

Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
Vadim Kaushan
2020-10-02 09:44:05 +03:00
committed by GitHub
parent ed76f702b1
commit 8c36d65e63
13 changed files with 285 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
# Bootloader test
# Bootloader testcase
1. `# Clean flash`
2. `make -C bootloader flash` `# Load bootloader`
@@ -34,4 +34,29 @@
11. Wait 0.5 s
12. `# Expect FW`
* Expect: uart welcome message
* Expect: USB Flipper CDC
* Expect: USB Flipper CDC
# Input testcase
1. `docker-compose exec dev make -C target_f2 example_input_dump`
2. Flash
3. For x in ```
[
(Up, "00"),
(Down, "01"),
(Right, "02"),
(Left, "03"),
(Ok, "04"),
(Back, "05"),
]
```
* Press ${x[0]}
* wait 0.05
* Expect: Uart: "event: ${x[1]} pressed"
* wait 0.05
* Release ${x[0]}
* wait 0.05
* Expect: Uart: "event: ${x[1]} released"
* wait 0.05
TODO: add debouncing check (multiple press and check there is no multiple events)