mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-11-24 03:07:21 +03:00
Fix crash in iButton notifications routine (#2074)
* iButton: send notifications less strictly * iButton: set notification callback earlier
This commit is contained in:
parent
2a6a3a1bf7
commit
eb3a8734fb
@ -131,7 +131,9 @@ void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode) {
|
||||
|
||||
void ibutton_worker_notify_emulate(iButtonWorker* worker) {
|
||||
iButtonMessage message = {.type = iButtonMessageNotifyEmulate};
|
||||
furi_check(furi_message_queue_put(worker->messages, &message, 0) == FuriStatusOk);
|
||||
// we're running in an interrupt context, so we can't wait
|
||||
// and we can drop message if queue is full, that's ok for that message
|
||||
furi_message_queue_put(worker->messages, &message, 0);
|
||||
}
|
||||
|
||||
void ibutton_worker_set_key_p(iButtonWorker* worker, iButtonKey* key) {
|
||||
|
@ -222,8 +222,8 @@ void ibutton_worker_emulate_dallas_start(iButtonWorker* worker) {
|
||||
memcpy(device_id, key_id, key_size);
|
||||
|
||||
onewire_slave_attach(worker->slave, worker->device);
|
||||
onewire_slave_start(worker->slave);
|
||||
onewire_slave_set_result_callback(worker->slave, onewire_slave_callback, worker);
|
||||
onewire_slave_start(worker->slave);
|
||||
}
|
||||
|
||||
void ibutton_worker_emulate_dallas_stop(iButtonWorker* worker) {
|
||||
|
Loading…
Reference in New Issue
Block a user