mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-17 05:48:33 +00:00
[FL-3188] Fix crash when emulating a DSGeneric key (#2530)
This commit is contained in:
parent
9a14699aa0
commit
fad24efdf0
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
furi_assert(context);
|
||||
DallasGenericProtocolData* data = context;
|
||||
if(!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;
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue