mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 13:09:49 +04:00
various fixes
by WillyJL
This commit is contained in:
@@ -213,9 +213,7 @@ static int32_t ducky_parse_line(BadUsbScript* bad_usb, FuriString* line) {
|
|||||||
|
|
||||||
// Main key
|
// Main key
|
||||||
char next_char = *line_cstr;
|
char next_char = *line_cstr;
|
||||||
uint16_t main_key = ducky_get_keycode_by_name(line_cstr);
|
key = modifiers | ducky_get_keycode(bad_usb, line_cstr, true);
|
||||||
if(!main_key && next_char) main_key = BADUSB_ASCII_TO_KEY(bad_usb, next_char);
|
|
||||||
key = modifiers | main_key;
|
|
||||||
|
|
||||||
if(key == 0 && next_char) ducky_error(bad_usb, "No keycode defined for %s", line_cstr);
|
if(key == 0 && next_char) ducky_error(bad_usb, "No keycode defined for %s", line_cstr);
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include <lib/nfc/nfc_poller.h>
|
#include <lib/nfc/nfc_poller.h>
|
||||||
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller.h>
|
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller.h>
|
||||||
#include <lib/nfc/protocols/iso14443_4b/iso14443_4b_poller.h>
|
#include <lib/nfc/protocols/iso14443_4b/iso14443_4b_poller.h>
|
||||||
#include <lib/nfc/protocols/iso15693_3/iso15693_3_poller.h>
|
|
||||||
#include <toolbox/pipe.h>
|
#include <toolbox/pipe.h>
|
||||||
|
|
||||||
#include <furi_hal_nfc.h>
|
#include <furi_hal_nfc.h>
|
||||||
@@ -15,13 +14,12 @@
|
|||||||
#define FLAG_EVENT (1 << 10)
|
#define FLAG_EVENT (1 << 10)
|
||||||
|
|
||||||
#define NFC_MAX_BUFFER_SIZE (256)
|
#define NFC_MAX_BUFFER_SIZE (256)
|
||||||
#define NFC_BASE_PROTOCOL_MAX (3)
|
#define NFC_BASE_PROTOCOL_MAX (2)
|
||||||
#define POLLER_DONE (1 << 0)
|
#define POLLER_DONE (1 << 0)
|
||||||
#define POLLER_ERR (1 << 1)
|
#define POLLER_ERR (1 << 1)
|
||||||
static NfcProtocol BASE_PROTOCOL[NFC_BASE_PROTOCOL_MAX] = {
|
static NfcProtocol BASE_PROTOCOL[NFC_BASE_PROTOCOL_MAX] = {
|
||||||
NfcProtocolIso14443_4a,
|
NfcProtocolIso14443_4a,
|
||||||
NfcProtocolIso14443_4b,
|
NfcProtocolIso14443_4b};
|
||||||
NfcProtocolIso15693_3};
|
|
||||||
typedef struct ApduContext {
|
typedef struct ApduContext {
|
||||||
BitBuffer* tx_buffer;
|
BitBuffer* tx_buffer;
|
||||||
BitBuffer* rx_buffer;
|
BitBuffer* rx_buffer;
|
||||||
@@ -88,19 +86,6 @@ static NfcCommand trx_callback(NfcGenericEvent event, void* context) {
|
|||||||
furi_thread_flags_set(apdu_context->thread_id, POLLER_ERR);
|
furi_thread_flags_set(apdu_context->thread_id, POLLER_ERR);
|
||||||
return NfcCommandStop;
|
return NfcCommandStop;
|
||||||
}
|
}
|
||||||
} else if(NfcProtocolIso15693_3 == event.protocol) {
|
|
||||||
Iso15693_3Error err = iso15693_3_poller_send_frame(
|
|
||||||
event.instance,
|
|
||||||
apdu_context->tx_buffer,
|
|
||||||
apdu_context->rx_buffer,
|
|
||||||
ISO15693_3_FDT_POLL_FC);
|
|
||||||
if(Iso15693_3ErrorNone == err) {
|
|
||||||
furi_thread_flags_set(apdu_context->thread_id, POLLER_DONE);
|
|
||||||
return NfcCommandContinue;
|
|
||||||
} else {
|
|
||||||
furi_thread_flags_set(apdu_context->thread_id, POLLER_ERR);
|
|
||||||
return NfcCommandStop;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// should never reach here
|
// should never reach here
|
||||||
furi_crash("Unknown protocol");
|
furi_crash("Unknown protocol");
|
||||||
|
|||||||
@@ -136,9 +136,9 @@ void cli_registry_reload_external_commands(
|
|||||||
FURI_LOG_T(TAG, "Plugin: %s", plugin_filename);
|
FURI_LOG_T(TAG, "Plugin: %s", plugin_filename);
|
||||||
furi_string_set_str(plugin_name, plugin_filename);
|
furi_string_set_str(plugin_name, plugin_filename);
|
||||||
|
|
||||||
furi_check(furi_string_end_with_str(plugin_name, ".fal"));
|
if(!furi_string_end_with_str(plugin_name, ".fal")) continue;
|
||||||
furi_string_replace_all_str(plugin_name, ".fal", "");
|
furi_string_replace_all_str(plugin_name, ".fal", "");
|
||||||
furi_check(furi_string_start_with_str(plugin_name, config->fal_prefix));
|
if(!furi_string_start_with_str(plugin_name, config->fal_prefix)) continue;
|
||||||
furi_string_replace_at(plugin_name, 0, strlen(config->fal_prefix), "");
|
furi_string_replace_at(plugin_name, 0, strlen(config->fal_prefix), "");
|
||||||
|
|
||||||
CliRegistryCommand command = {
|
CliRegistryCommand command = {
|
||||||
|
|||||||
Reference in New Issue
Block a user