Merge pull request #2173 from wh201906/lf_sniff_clean

Real-time LF sampling
This commit is contained in:
Iceman authored and GitHub committed 2023-12-01 10:54:10 +01:00
commit 17a93a3b1b
24 files changed
+900 -231

No files matched your search

+17
View File
@@ -196,4 +196,21 @@ extern bool g_tearoff_enabled;
#define CLEAR_BIT(data, i) *(data + (i / 8)) &= ~(1 << (7 - (i % 8)))
#define FLIP_BIT(data, i) *(data + (i / 8)) ^= (1 << (7 - (i % 8)))
// time for decompressing and loading the image to the FPGA
#define FPGA_LOAD_WAIT_TIME (1500)
// GCC extension
// from client/deps/tinycbor/compilersupport_p.h
#ifdef __GNUC__
#ifndef likely
# define likely(x) __builtin_expect(!!(x), 1)
#endif
#ifndef unlikely
# define unlikely(x) __builtin_expect(!!(x), 0)
#endif
#else
# define likely(x) (x)
# define unlikely(x) (x)
#endif
#endif
+11
View File
@@ -274,6 +274,17 @@ typedef struct {
uint8_t data[];
} PACKED lf_hitag_t;
// For CMD_LF_SNIFF_RAW_ADC and CMD_LF_ACQ_RAW_ADC
#define LF_SAMPLES_BITS 30
#define MAX_LF_SAMPLES ((((uint32_t)1u) << LF_SAMPLES_BITS) - 1)
typedef struct {
// 64KB SRAM -> 524288 bits(max sample num) < 2^30
uint32_t samples : LF_SAMPLES_BITS;
bool realtime : 1;
bool verbose : 1;
} PACKED lf_sample_payload_t;
typedef struct {
uint8_t blockno;
uint8_t keytype;