mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge branch 'dev' of https://github.com/flipperdevices/flipperzero-firmware into xfw-dev
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
|
||||
const ProtocolBase* lfrfid_protocols[] = {
|
||||
[LFRFIDProtocolEM4100] = &protocol_em4100,
|
||||
[LFRFIDProtocolEM4100_32] = &protocol_em4100_32,
|
||||
[LFRFIDProtocolEM410032] = &protocol_em4100_32,
|
||||
[LFRFIDProtocolEM410016] = &protocol_em4100_16,
|
||||
[LFRFIDProtocolH10301] = &protocol_h10301,
|
||||
[LFRFIDProtocolIdteck] = &protocol_idteck,
|
||||
[LFRFIDProtocolIndala26] = &protocol_indala26,
|
||||
|
||||
@@ -9,7 +9,8 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
LFRFIDProtocolEM4100,
|
||||
LFRFIDProtocolEM4100_32,
|
||||
LFRFIDProtocolEM410032,
|
||||
LFRFIDProtocolEM410016,
|
||||
LFRFIDProtocolH10301,
|
||||
LFRFIDProtocolIdteck,
|
||||
LFRFIDProtocolIndala26,
|
||||
|
||||
@@ -45,6 +45,8 @@ uint16_t protocol_em4100_get_time_divisor(ProtocolEM4100* proto) {
|
||||
return 1;
|
||||
case 32:
|
||||
return 2;
|
||||
case 16:
|
||||
return 4;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
@@ -56,6 +58,8 @@ uint32_t protocol_em4100_get_t5577_bitrate(ProtocolEM4100* proto) {
|
||||
return LFRFID_T5577_BITRATE_RF_64;
|
||||
case 32:
|
||||
return LFRFID_T5577_BITRATE_RF_32;
|
||||
case 16:
|
||||
return LFRFID_T5577_BITRATE_RF_16;
|
||||
default:
|
||||
return LFRFID_T5577_BITRATE_RF_64;
|
||||
}
|
||||
@@ -87,6 +91,12 @@ ProtocolEM4100* protocol_em4100_alloc(void) {
|
||||
return (void*)proto;
|
||||
};
|
||||
|
||||
ProtocolEM4100* protocol_em4100_16_alloc(void) {
|
||||
ProtocolEM4100* proto = malloc(sizeof(ProtocolEM4100));
|
||||
proto->clock_per_bit = 16;
|
||||
return (void*)proto;
|
||||
};
|
||||
|
||||
ProtocolEM4100* protocol_em4100_32_alloc(void) {
|
||||
ProtocolEM4100* proto = malloc(sizeof(ProtocolEM4100));
|
||||
proto->clock_per_bit = 32;
|
||||
@@ -373,3 +383,27 @@ const ProtocolBase protocol_em4100_32 = {
|
||||
.render_brief_data = (ProtocolRenderData)protocol_em4100_render_data,
|
||||
.write_data = (ProtocolWriteData)protocol_em4100_write_data,
|
||||
};
|
||||
|
||||
const ProtocolBase protocol_em4100_16 = {
|
||||
.name = "EM4100/16",
|
||||
.manufacturer = "EM-Micro",
|
||||
.data_size = EM4100_DECODED_DATA_SIZE,
|
||||
.features = LFRFIDFeatureASK | LFRFIDFeaturePSK,
|
||||
.validate_count = 3,
|
||||
.alloc = (ProtocolAlloc)protocol_em4100_16_alloc,
|
||||
.free = (ProtocolFree)protocol_em4100_free,
|
||||
.get_data = (ProtocolGetData)protocol_em4100_get_data,
|
||||
.decoder =
|
||||
{
|
||||
.start = (ProtocolDecoderStart)protocol_em4100_decoder_start,
|
||||
.feed = (ProtocolDecoderFeed)protocol_em4100_decoder_feed,
|
||||
},
|
||||
.encoder =
|
||||
{
|
||||
.start = (ProtocolEncoderStart)protocol_em4100_encoder_start,
|
||||
.yield = (ProtocolEncoderYield)protocol_em4100_encoder_yield,
|
||||
},
|
||||
.render_data = (ProtocolRenderData)protocol_em4100_render_data,
|
||||
.render_brief_data = (ProtocolRenderData)protocol_em4100_render_data,
|
||||
.write_data = (ProtocolWriteData)protocol_em4100_write_data,
|
||||
};
|
||||
|
||||
@@ -4,3 +4,5 @@
|
||||
extern const ProtocolBase protocol_em4100;
|
||||
|
||||
extern const ProtocolBase protocol_em4100_32;
|
||||
|
||||
extern const ProtocolBase protocol_em4100_16;
|
||||
|
||||
@@ -139,4 +139,4 @@ void t5577_write_with_mask(LFRFIDT5577* data, uint8_t page, bool with_pass, uint
|
||||
t5577_write_reset();
|
||||
FURI_CRITICAL_EXIT();
|
||||
t5577_stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user