Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout for custom menu commits #164

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mini-ninja-64
Copy link

@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.

None yet

1 participant