Skip to content

Conversation

tinooo
Copy link
Contributor

@tinooo tinooo commented Mar 13, 2025

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.

tinooo added 11 commits March 12, 2025 17:38
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.
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
Copy link

You are welcome to add an entry to the CHANGELOG.md as well

tinooo added 2 commits March 14, 2025 09:01
the github pipeline was stressed about comparing an uint16_t to an uint32_t.
@iceman1001 iceman1001 merged commit 02511e0 into RfidResearchGroup:master Mar 14, 2025
12 checks passed
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.

2 participants