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
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.
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.
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?
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.
* .h include only the strict minimum for their own parsing
* this forces all files to include explicitment their needs and not count on far streched dependencies
* this helps Makefile to rebuild only the minimum
* according to this rule, most standalone .h are now gone
* big app.h is gone
* remove seldom __cplusplus, if c++ happens, everything will have to be done properly anyway
* all unrequired include were removed
* split common/ into common/ (client+arm) and common_arm/ (os+bootloader)
* bring zlib to common/
* bring stuff not really/not yet used in common back to armsrc/ or client/
* bring liblua into client/
* bring uart into client/
* move some portions of code around (dbprint, protocols,...)
* rename unused files into *_disabled.[ch] to make it explicit
* rename soft Uarts between 14a, 14b and iclass, so a standalone could use several without clash
* remove PrintAndLogDevice
* move deprecated-hid-flasher from client to tools
* Makefiles
* treat deps in armsrc/ as in client/
* client: stop on warning (-Werror), same as for armsrc/
Tested on:
* all standalone modes
* Linux
ADD: @marshmellows "diphase" definition for T55x7.
MOV: extracted the aquisition from the t55x7 methods and put them inside lfsampling.c
FIX: pcf7931 write, there is 16bytes in a block.. not 4 as I thought before.
FIX: t55x7 lowered the WRITE_0 to 16. Even bigger gap.