-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PCF7931 refactor and documentation #2779
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
Merged
iceman1001
merged 13 commits into
RfidResearchGroup:master
from
tinooo:pcf7930-refactor-and-documentation
Mar 14, 2025
Merged
PCF7931 refactor and documentation #2779
iceman1001
merged 13 commits into
RfidResearchGroup:master
from
tinooo:pcf7930-refactor-and-documentation
Mar 14, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firs commit of a few to come. First renames of variables, added a few comments to improve clarity. Fixed types (int -> unitx_t , const, ...) - not all. still some to come Fixed 2 conditions that did not work properly. Here some explanation: Imagine dest[i-1] = 255 and dest[i] = 0. THis would mean a clear falling edge. However, this code would not work, since dest[i] > lmax is not true. This condition only works if I have at least 1 sample between lmax and 255. Same for the other way around.
demod function now seems to work basically. Not all error cases are handled I guess. Also still debug prints, since I've to figure out the rest. Also unclear, why limit the buffer size to 1-2 blocks only?
still not done with DemodPCF7931(). But now including changes in ReadPCF7931(). They work tightly together. Trying to resolve some issues and bugs. Basically it seems to work and my results are consistent. However, they still deviate from what I get if I do analyze the signal using lf read and data commands. still some issues somewhere.
added comments
unneccessary returns.
rename some variables for more clear reading changed data type to meaningfull size
first steps in understading and optimizing this function. replace != with < - if we don't poll fast enough, it is possible that the condition != is missed.
move "remapping" of dataframes to the actual send function, where the timer is located
different tags seem to behave differently. an old tag from the car had way worse signal. Therefore filtering made it way better. Still not ideal.
since this is somekind of work in progress, I'm still going for a PR. This commit is reworking some comments and making the code stable (at least as good es or better as before). Also made als const as #define
You are welcome to add an entry to the CHANGELOG.md as well |
the github pipeline was stressed about comparing an uint16_t to an uint32_t.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've tried to get the pcf7931 functions working properly.
First put in a bit more structure, unified data types and tried to use meaningful names for variables.
Furthermore, I've tried to fix the read function. It was working very poorly, and had plenty bugs. It still is not working ideally, but now at least the frames that have been read, will be printed for the user.
The sorting of the frames is not working yet (I've also not tried to make it work, since there are bigger issues to be solved).
For the write functions, I've not made any major change. Theoretically it should work. But i was not able to verify.
In a future PR, one should optimize the write function in a way, that the PMC bit will be automatically found, and no "initialization delay" has to be specified by the user. Or at least, there needs to be an info, HOW to find out this delay. Because I have not been able to do so yet.