[FL-3188] Fix crash when emulating a DSGeneric key (#2530)
This commit is contained in:
parent
9a14699aa0
commit
fad24efdf0
@ -62,6 +62,7 @@ bool ds_generic_write_blank(OneWireHost* host, iButtonProtocolData* protocol_dat
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool ds_generic_reset_callback(bool is_short, void* context) {
|
static bool ds_generic_reset_callback(bool is_short, void* context) {
|
||||||
|
furi_assert(context);
|
||||||
DallasGenericProtocolData* data = context;
|
DallasGenericProtocolData* data = context;
|
||||||
if(!is_short) {
|
if(!is_short) {
|
||||||
onewire_slave_set_overdrive(data->state.bus, is_short);
|
onewire_slave_set_overdrive(data->state.bus, is_short);
|
||||||
@ -93,7 +94,7 @@ void ds_generic_emulate(OneWireSlave* bus, iButtonProtocolData* protocol_data) {
|
|||||||
DallasGenericProtocolData* data = protocol_data;
|
DallasGenericProtocolData* data = protocol_data;
|
||||||
data->state.bus = bus;
|
data->state.bus = bus;
|
||||||
|
|
||||||
onewire_slave_set_reset_callback(bus, ds_generic_reset_callback, NULL);
|
onewire_slave_set_reset_callback(bus, ds_generic_reset_callback, protocol_data);
|
||||||
onewire_slave_set_command_callback(bus, ds_generic_command_callback, protocol_data);
|
onewire_slave_set_command_callback(bus, ds_generic_command_callback, protocol_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user