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

Make the filter state instance data #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edgar-bonet
Copy link

@edgar-bonet edgar-bonet commented Apr 15, 2022

The filter state is presently stored in the global variables LPF, HPF and AHF. The fact that these are global means that all instances of EMGFilters share the same state, and thus interact with each other.

This pull request makes this state per-instance data, thus making it possible to use multiple filter instances.

Fixes #3.
Fixes #7.

Note: the patch looks big, but only because the indentation level changed for the methods of FILTER_2nd and FILTER_4th. If displayed as git diff -b, it is a small patch.

In order for multiple instances of EMGFilters to be able to work
independently, they must each store its own state. Make this state
private class members instead of global variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant