Commit 87277e6
GPIO-based Input mode and profile select on boot (#1620)
* Add array of new GpioInputMapping type to GamepadOptions
* Add new branch to getBootAction which uses gpioInputModeMappings
* Use std::optional instead of negative value
* Move details of boot mode form out to separate funtion, start on gpio input form
* Move FormSelect to a separate component
* Outline form for gpio mapping
* Update test data
* Define useStore hook for input boot modes
* Rename boto mode fields. Add profile index to boot mode config
* Restoring settings page from main (switching to a brand new page instead)
* Moving config to separate Options object. Add pin masks for web config and usb mode (required)
* Move INPUT_MODES from settings page to Data/ file
* work on BootModeStore
* Stub out web api methods, add test data
* Create a React component for boot mode mapping
* Add profile select, general layout tweaks
* UI tweaks
* Add a toggle to switch between old and new boot mode mapping
* Use nanoid to give a unique key to boot-modes in list. Implement missing actions
* combine various add/remove pin funtions. Re-writes to make sure sets are updated immutably
* Refactoring components so there are fewer state subscriptions in the top-level BootModeMapping
* Split up PinSelect into two types to simplify zustand selectors. Fix deleting of pins
* Pull first 2 rows out into a component to memoize, organization.
* Check if usb peripheral is available in BootModeSelect
* Refactor BootModesStore to use string keys instead of indices
* Start replacing labels with useTranslation
* Start working on some validation for gpio pin mapping
* Renaming fields in config
* use InputMode enum instaed of int
* Renamed component
* Rename APIs, update test data
* Move BootModeMapping back to a Page
* WIP add a method of highlighting invalid selects
* Add nav item for boot modes. Link to page once GPIO mapping is enabled
* re-order CSS to fix issue with hover on invalid selects
* Work on validaton for required fields
* Further validation improvements, group actions together
* Disable boot mode page based on setting
* Fix typo
* Add BootModeOptions to Storage class
* Implement pin-checking logic at startup
* Add BootModeOptions to Config, change index to unsigned int
* Implement the boot mode options API
* Disable new boot-mode selection for now
* Fix typos in JSON keys
* Move enabled switch to Boot mode page. Clear errors after adding pin with capture button
* Add missing enabled field, fix save method
* Fix typos in JSON keys
* Fix issue with profile not being saved correctly
* Return profile number along with BootAction from getBootAction
* Move error messages out of BootModeStore. Use 1-indexed profile number from controller
* Update spaPaths, change profileIndex to profileNumber
* Update getBootAction signature
* Delete old getBootMode function for now
* Ignore prettier config
* Add function for setting pin mapping from boot mode options
* Define new struct for controlling boot actions. Reduce the amount of mapping between enums in switch statements
* Add missing method declaration
* Rename profileIndex to profileNumber. Change required masks to uint32_t (no need for -1)
* Reverting some upstream changes from post-0.7.12 that were left during rebase
* Fix config, broken during rebase
* Fixes to getBootAction implementation
* Make sure save button is accessible when Gpio mode-select disabled
* Add a "dirty" field to boot mode state to better handle saving
* Restore old getBootAction func
* Rework old getBootAction to work with new BootAction type
* Disable reserved pins in drop-down
* Fix bug with wrong inputMode being used
* Cast enabled to boolean (was showing up as 0 in web config)
* Add locale file. Add an explanation and alert-message
* Move more text to locale file
* Rename BootModeMappingPage.jsx to just BootModeMapping.jsx
* Add P5General to InputBootModes (lost in merge)
* Call old bootAction method, even if new mode is enabled
---------
Co-authored-by: Luke A <arntsonl@gmail.com>1 parent c9780ac commit 87277e6
21 files changed
Lines changed: 1353 additions & 356 deletions
File tree
- headers
- addons
- proto
- src
- www
- server
- src
- Components
- Data
- Locales/en
- Pages
- Services
- Store
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
69 | 60 | | |
70 | 61 | | |
71 | 62 | | |
| |||
76 | 67 | | |
77 | 68 | | |
78 | 69 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 70 | | |
83 | 71 | | |
84 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
6 | 20 | | |
7 | 21 | | |
8 | 22 | | |
| |||
955 | 969 | | |
956 | 970 | | |
957 | 971 | | |
| 972 | + | |
958 | 973 | | |
0 commit comments