hitag signal refactoring
This commit is contained in:
@@ -23,7 +23,7 @@ APP_CFLAGS = $(PLATFORM_DEFS) \
|
||||
-DON_DEVICE \
|
||||
-fno-strict-aliasing -ffunction-sections -fdata-sections
|
||||
|
||||
SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c
|
||||
SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c lfadc.c
|
||||
SRC_ISO15693 = iso15693.c iso15693tools.c
|
||||
SRC_ISO14443a = iso14443a.c mifareutil.c mifarecmd.c epa.c mifaresim.c
|
||||
#UNUSED: mifaresniff.c desfire_crypto.c
|
||||
|
||||
821
armsrc/hitag2.c
821
armsrc/hitag2.c
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@
|
||||
#include "common.h"
|
||||
#include "hitag.h"
|
||||
|
||||
void SniffHitag(void);
|
||||
void SniffHitag(uint32_t type);
|
||||
void SimulateHitagTag(bool tag_mem_supplied, uint8_t *data);
|
||||
void ReaderHitag(hitag_function htf, hitag_data *htd);
|
||||
void WriterHitag(hitag_function htf, hitag_data *htd, int page);
|
||||
|
||||
@@ -168,7 +168,9 @@ void lf_init(bool reader) {
|
||||
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKEN | AT91C_TC_SWTRG;
|
||||
|
||||
// Prepare data trace
|
||||
if (logging) initSampleBuffer(NULL);
|
||||
uint32_t bufsize = 20000;
|
||||
|
||||
if (logging) initSampleBuffer(&bufsize);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -106,17 +106,23 @@ sampling_t samples = {0, 0, 0, 0};
|
||||
|
||||
void initSampleBuffer(uint32_t *sample_size) {
|
||||
|
||||
BigBuf_free();
|
||||
BigBuf_Clear_ext(false);
|
||||
|
||||
if (sample_size == NULL || *sample_size == 0) {
|
||||
*sample_size = BigBuf_max_traceLen();
|
||||
|
||||
data.buffer = BigBuf_get_addr();
|
||||
|
||||
memset(data.buffer, 0, *sample_size);
|
||||
} else {
|
||||
*sample_size = MIN(*sample_size, BigBuf_max_traceLen());
|
||||
|
||||
data.buffer = BigBuf_malloc(*sample_size);
|
||||
|
||||
memset(data.buffer, 0, *sample_size);
|
||||
}
|
||||
|
||||
// use a bitstream to handle the output
|
||||
data.buffer = BigBuf_get_addr();
|
||||
|
||||
memset(data.buffer, 0, *sample_size);
|
||||
|
||||
//
|
||||
samples.dec_counter = 0;
|
||||
samples.sum = 0;
|
||||
|
||||
Reference in New Issue
Block a user