Merge branch 'flipperdevices:dev' into dev

This commit is contained in:
Eng1n33r
2022-05-11 18:53:49 +03:00
committed by GitHub
6 changed files with 121 additions and 6 deletions
+11
View File
@@ -9,6 +9,7 @@ typedef enum {
iButtonMessageRead,
iButtonMessageWrite,
iButtonMessageEmulate,
iButtonMessageNotifyEmulate,
} iButtonMessageType;
typedef struct {
@@ -145,6 +146,11 @@ void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode) {
ibutton_worker_modes[worker->mode_index].start(worker);
}
void ibutton_worker_notify_emulate(iButtonWorker* worker) {
iButtonMessage message = {.type = iButtonMessageNotifyEmulate};
furi_check(osMessageQueuePut(worker->messages, &message, 0, 0) == osOK);
}
void ibutton_worker_set_key_p(iButtonWorker* worker, iButtonKey* key) {
worker->key_p = key;
}
@@ -183,6 +189,11 @@ static int32_t ibutton_worker_thread(void* thread_context) {
ibutton_worker_set_key_p(worker, message.data.key);
ibutton_worker_switch_mode(worker, iButtonWorkerEmulate);
break;
case iButtonMessageNotifyEmulate:
if(worker->emulate_cb) {
worker->emulate_cb(worker->cb_ctx, true);
}
break;
}
} else if(status == osErrorTimeout) {
ibutton_worker_modes[worker->mode_index].tick(worker);
+1
View File
@@ -73,6 +73,7 @@ struct iButtonWorker {
extern const iButtonWorkerModeType ibutton_worker_modes[];
void ibutton_worker_switch_mode(iButtonWorker* worker, iButtonWorkerMode mode);
void ibutton_worker_notify_emulate(iButtonWorker* worker);
#ifdef __cplusplus
}
+1 -3
View File
@@ -184,9 +184,7 @@ void ibutton_worker_mode_read_stop(iButtonWorker* worker) {
static void onewire_slave_callback(void* context) {
furi_assert(context);
iButtonWorker* worker = context;
if(worker->emulate_cb != NULL) {
worker->emulate_cb(worker->cb_ctx, true);
}
ibutton_worker_notify_emulate(worker);
}
void ibutton_worker_emulate_dallas_start(iButtonWorker* worker) {
+2 -2
View File
@@ -1,12 +1,12 @@
#include "registry.h"
const SubGhzProtocol* subghz_protocol_registry[] = {
&subghz_protocol_princeton, &subghz_protocol_keeloq, &subghz_protocol_star_line,
&subghz_protocol_gate_tx, &subghz_protocol_keeloq, &subghz_protocol_star_line,
&subghz_protocol_nice_flo, &subghz_protocol_came, &subghz_protocol_faac_slh,
&subghz_protocol_nice_flor_s, &subghz_protocol_came_twee, &subghz_protocol_came_atomo,
&subghz_protocol_nero_sketch, &subghz_protocol_ido, &subghz_protocol_kia,
&subghz_protocol_hormann, &subghz_protocol_nero_radio, &subghz_protocol_somfy_telis,
&subghz_protocol_somfy_keytis, &subghz_protocol_scher_khan, &subghz_protocol_gate_tx,
&subghz_protocol_somfy_keytis, &subghz_protocol_scher_khan, &subghz_protocol_princeton,
&subghz_protocol_raw, &subghz_protocol_firefly, &subghz_protocol_secplus_v2,
&subghz_protocol_secplus_v1, &subghz_protocol_megacode, &subghz_protocol_holtek,