mf plus: code clean up

This commit is contained in:
gornekich 2024-05-29 16:53:12 +01:00
parent 8cdb8aafac
commit 6ccbc16e74
4 changed files with 6 additions and 9 deletions

View file

@ -2,13 +2,11 @@
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a.h>
#include <lib/toolbox/simple_array.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MF_PLUS_UID_SIZE (7)
#define MF_PLUS_UID_SIZE_MAX (7)
#define MF_PLUS_BATCH_SIZE (5)
#define MF_PLUS_CMD_GET_VERSION (0x60)
@ -71,7 +69,7 @@ typedef struct {
uint8_t sw_storage;
uint8_t sw_proto;
uint8_t uid[MF_PLUS_UID_SIZE];
uint8_t uid[MF_PLUS_UID_SIZE_MAX];
uint8_t batch[MF_PLUS_BATCH_SIZE];
uint8_t prod_week;
uint8_t prod_year;

View file

@ -139,13 +139,12 @@ static void mf_plus_poller_set_callback(
}
static NfcCommand mf_plus_poller_run(NfcGenericEvent event, void* context) {
furi_assert(context);
furi_assert(event.protocol = NfcProtocolIso14443_4a);
furi_assert(event.event_data);
MfPlusPoller* instance = context;
furi_assert(instance);
const Iso14443_4aPollerEvent* iso14443_4a_event = event.event_data;
furi_assert(iso14443_4a_event);
NfcCommand command = NfcCommandContinue;

View file

@ -55,7 +55,7 @@ MfPlusError mf_plus_poller_read_version(MfPlusPoller* instance, MfPlusVersion* d
bit_buffer_reset(instance->input_buffer);
bit_buffer_append_byte(instance->input_buffer, MF_PLUS_CMD_GET_VERSION);
MfPlusError error;
MfPlusError error = MfPlusErrorNone;
do {
error =