Skip to content

Add timeout for custom menu commits#164

Open
mini-ninja-64 wants to merge 2 commits intothe-via:mainfrom
Cutie-Club:add-save-timeout
Open

Add timeout for custom menu commits#164
mini-ninja-64 wants to merge 2 commits intothe-via:mainfrom
Cutie-Club:add-save-timeout

Conversation

@mini-ninja-64
Copy link
Copy Markdown

@mini-ninja-64 mini-ninja-64 commented May 8, 2023

Hello while implementing a custom menu for my device I found what appears to be a disagreement between the documentation and behaviour of VIA.

The VIA docs currently state the following:

The id_custom_save command is sent after one or more id_custom_set_value commands have been sent, and after a small delay. It is used to allow the firmware to defer writing to EEPROM and respond to set value commands quickly.

However the current VIA codebase will push a custom menu save command for every custom menu set it does, this is not ideal for the EEPROM as such it would be best in my opinion to defer writing to the EEPROM until we are sure that the user has settled on a value.

To fix this I have offloaded the sending of a custom menu save command to a function that is executed only once 250ms has passed without any custom menu updates.

I am very happy to update and change the solution chosen as there are of course multiple ways to proceed with this problem, including moving the tackling of EEPROM save timing to firmware.

I was also unsure whether or not I should open an associated issue to link to this PR, let me know if that would be useful.

@mini-ninja-64 mini-ninja-64 marked this pull request as ready for review May 8, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant