mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-27 01:58:09 -07:00
Merge branch 'ul-dev' into xfw-dev
This commit is contained in:
@@ -45,11 +45,14 @@ void platformDisableIrqCallback() {
|
||||
|
||||
void platformSetIrqCallback(PlatformIrqCallback callback) {
|
||||
rfal_platform.callback = callback;
|
||||
rfal_platform.thread =
|
||||
furi_thread_alloc_ex("RfalIrqDriver", 1024, rfal_platform_irq_thread, NULL);
|
||||
furi_thread_mark_as_service(rfal_platform.thread);
|
||||
furi_thread_set_priority(rfal_platform.thread, FuriThreadPriorityIsr);
|
||||
furi_thread_start(rfal_platform.thread);
|
||||
|
||||
if(!rfal_platform.thread) {
|
||||
rfal_platform.thread =
|
||||
furi_thread_alloc_ex("RfalIrqDriver", 1024, rfal_platform_irq_thread, NULL);
|
||||
furi_thread_mark_as_service(rfal_platform.thread);
|
||||
furi_thread_set_priority(rfal_platform.thread, FuriThreadPriorityIsr);
|
||||
furi_thread_start(rfal_platform.thread);
|
||||
}
|
||||
|
||||
furi_hal_gpio_add_int_callback(&gpio_nfc_irq_rfid_pull, nfc_isr, NULL);
|
||||
// Disable interrupt callback as the pin is shared between 2 apps
|
||||
|
||||
+1
-1
Submodule lib/STM32CubeWB updated: a9e29b431f...c4cec8ae57
@@ -1,7 +1,7 @@
|
||||
#include "custom_btn.h"
|
||||
|
||||
static uint8_t custom_btn_id;
|
||||
static uint8_t custom_btn_original;
|
||||
static uint8_t custom_btn_id = 0;
|
||||
static uint8_t custom_btn_original = 0;
|
||||
static uint8_t custom_btn_max_btns = 0;
|
||||
|
||||
void subghz_custom_btn_set(uint8_t b) {
|
||||
|
||||
@@ -152,7 +152,7 @@ SubGhzProtocolStatus subghz_block_generic_deserialize_check_count_bit(
|
||||
break;
|
||||
}
|
||||
if(instance->data_count_bit != count_bit) {
|
||||
FURI_LOG_E(TAG, "Wrong number of bits in key");
|
||||
FURI_LOG_D(TAG, "Wrong number of bits in key");
|
||||
ret = SubGhzProtocolStatusErrorValueBitCount;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ SubGhzEnvironment* subghz_environment_alloc() {
|
||||
instance->protocol_registry = NULL;
|
||||
instance->came_atomo_rainbow_table_file_name = NULL;
|
||||
instance->nice_flor_s_rainbow_table_file_name = NULL;
|
||||
instance->alutech_at_4n_rainbow_table_file_name = NULL;
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -26,6 +27,7 @@ void subghz_environment_free(SubGhzEnvironment* instance) {
|
||||
instance->protocol_registry = NULL;
|
||||
instance->came_atomo_rainbow_table_file_name = NULL;
|
||||
instance->nice_flor_s_rainbow_table_file_name = NULL;
|
||||
instance->alutech_at_4n_rainbow_table_file_name = NULL;
|
||||
subghz_keystore_free(instance->keystore);
|
||||
|
||||
free(instance);
|
||||
|
||||
@@ -79,6 +79,11 @@ const SubGhzProtocol subghz_protocol_alutech_at_4n = {
|
||||
.encoder = &subghz_protocol_alutech_at_4n_encoder,
|
||||
};
|
||||
|
||||
static void subghz_protocol_alutech_at_4n_remote_controller(
|
||||
SubGhzBlockGeneric* instance,
|
||||
uint8_t crc,
|
||||
const char* file_name);
|
||||
|
||||
void* subghz_protocol_encoder_alutech_at_4n_alloc(SubGhzEnvironment* environment) {
|
||||
UNUSED(environment);
|
||||
SubGhzProtocolEncoderAlutech_at_4n* instance =
|
||||
@@ -503,10 +508,18 @@ SubGhzProtocolStatus subghz_protocol_encoder_alutech_at_4n_deserialize(
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_format_read_uint32(flipper_format, "CRC", (uint32_t*)&instance->crc, 1)) {
|
||||
FURI_LOG_E(TAG, "Missing CRC");
|
||||
break;
|
||||
}
|
||||
|
||||
//optional parameter parameter
|
||||
flipper_format_read_uint32(
|
||||
flipper_format, "Repeat", (uint32_t*)&instance->encoder.repeat, 1);
|
||||
|
||||
subghz_protocol_alutech_at_4n_remote_controller(
|
||||
&instance->generic, instance->crc, instance->alutech_at_4n_rainbow_table_file_name);
|
||||
|
||||
subghz_protocol_encoder_alutech_at_4n_get_upload(instance, instance->generic.btn);
|
||||
|
||||
if(!flipper_format_rewind(flipper_format)) {
|
||||
|
||||
@@ -393,7 +393,6 @@ static bool
|
||||
|
||||
uint8_t custom_btn_id = subghz_custom_btn_get();
|
||||
uint8_t original_btn_num = subghz_custom_btn_get_original();
|
||||
|
||||
// Set custom button
|
||||
if(custom_btn_id == 1) {
|
||||
switch(original_btn_num) {
|
||||
@@ -499,11 +498,9 @@ static bool
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if((custom_btn_id == 0) && (original_btn_num != 0)) {
|
||||
btn = original_btn_num;
|
||||
}
|
||||
|
||||
// Generate new key
|
||||
|
||||
if(subghz_protocol_keeloq_gen_data(instance, btn, true)) {
|
||||
|
||||
@@ -117,8 +117,7 @@ static bool
|
||||
}
|
||||
|
||||
//Send start bit
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(true, (uint32_t)subghz_protocol_nero_radio_const.te_short * 4);
|
||||
instance->encoder.upload[index++] = level_duration_make(true, (uint32_t)830);
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(false, (uint32_t)subghz_protocol_nero_radio_const.te_short);
|
||||
|
||||
@@ -142,14 +141,22 @@ static bool
|
||||
//send bit 1
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(true, (uint32_t)subghz_protocol_nero_radio_const.te_long);
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(false, (uint32_t)subghz_protocol_nero_radio_const.te_short * 37);
|
||||
if(instance->generic.data_count_bit == 57) {
|
||||
instance->encoder.upload[index++] = level_duration_make(false, (uint32_t)1300);
|
||||
} else {
|
||||
instance->encoder.upload[index++] = level_duration_make(
|
||||
false, (uint32_t)subghz_protocol_nero_radio_const.te_short * 23);
|
||||
}
|
||||
} else {
|
||||
//send bit 0
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(true, (uint32_t)subghz_protocol_nero_radio_const.te_short);
|
||||
instance->encoder.upload[index++] =
|
||||
level_duration_make(false, (uint32_t)subghz_protocol_nero_radio_const.te_short * 37);
|
||||
if(instance->generic.data_count_bit == 57) {
|
||||
instance->encoder.upload[index++] = level_duration_make(false, (uint32_t)1300);
|
||||
} else {
|
||||
instance->encoder.upload[index++] = level_duration_make(
|
||||
false, (uint32_t)subghz_protocol_nero_radio_const.te_short * 23);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -164,8 +171,14 @@ SubGhzProtocolStatus
|
||||
&instance->generic,
|
||||
flipper_format,
|
||||
subghz_protocol_nero_radio_const.min_count_bit_for_found);
|
||||
if(ret != SubGhzProtocolStatusOk) {
|
||||
break;
|
||||
|
||||
if((ret == SubGhzProtocolStatusErrorValueBitCount) &&
|
||||
(instance->generic.data_count_bit == 57)) {
|
||||
ret = SubGhzProtocolStatusOk;
|
||||
} else {
|
||||
if(ret != SubGhzProtocolStatusOk) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//optional parameter parameter
|
||||
flipper_format_read_uint32(
|
||||
@@ -284,8 +297,7 @@ void subghz_protocol_decoder_nero_radio_feed(void* context, bool level, uint32_t
|
||||
break;
|
||||
case NeroRadioDecoderStepCheckDuration:
|
||||
if(!level) {
|
||||
if(duration >= ((uint32_t)subghz_protocol_nero_radio_const.te_short * 10 +
|
||||
subghz_protocol_nero_radio_const.te_delta * 2)) {
|
||||
if(duration >= ((uint32_t)1250)) {
|
||||
//Found stop bit
|
||||
if(DURATION_DIFF(
|
||||
instance->decoder.te_last, subghz_protocol_nero_radio_const.te_short) <
|
||||
@@ -298,8 +310,10 @@ void subghz_protocol_decoder_nero_radio_feed(void* context, bool level, uint32_t
|
||||
subghz_protocol_blocks_add_bit(&instance->decoder, 1);
|
||||
}
|
||||
instance->decoder.parser_step = NeroRadioDecoderStepReset;
|
||||
if(instance->decoder.decode_count_bit ==
|
||||
subghz_protocol_nero_radio_const.min_count_bit_for_found) {
|
||||
if((instance->decoder.decode_count_bit ==
|
||||
subghz_protocol_nero_radio_const.min_count_bit_for_found) ||
|
||||
(instance->decoder.decode_count_bit ==
|
||||
subghz_protocol_nero_radio_const.min_count_bit_for_found + 1)) {
|
||||
instance->generic.data = instance->decoder.decode_data;
|
||||
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
|
||||
|
||||
@@ -356,10 +370,19 @@ SubGhzProtocolStatus
|
||||
subghz_protocol_decoder_nero_radio_deserialize(void* context, FlipperFormat* flipper_format) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderNeroRadio* instance = context;
|
||||
return subghz_block_generic_deserialize_check_count_bit(
|
||||
SubGhzProtocolStatus stat;
|
||||
|
||||
stat = subghz_block_generic_deserialize_check_count_bit(
|
||||
&instance->generic,
|
||||
flipper_format,
|
||||
subghz_protocol_nero_radio_const.min_count_bit_for_found);
|
||||
|
||||
if((stat == SubGhzProtocolStatusErrorValueBitCount) &&
|
||||
(instance->generic.data_count_bit == 57)) {
|
||||
return SubGhzProtocolStatusOk;
|
||||
} else {
|
||||
return stat;
|
||||
}
|
||||
}
|
||||
|
||||
void subghz_protocol_decoder_nero_radio_get_string(void* context, FuriString* output) {
|
||||
|
||||
@@ -244,8 +244,8 @@ void subghz_protocol_decoder_raw_reset(void* context) {
|
||||
void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t duration) {
|
||||
furi_assert(context);
|
||||
SubGhzProtocolDecoderRAW* instance = context;
|
||||
|
||||
if(!instance->pause && (instance->upload_raw != NULL)) {
|
||||
// Add check if we got duration higher than 1 second, we skipping it, temp fix
|
||||
if((!instance->pause && (instance->upload_raw != NULL)) && (duration < ((uint32_t)1000000))) {
|
||||
if(duration > subghz_protocol_raw_const.te_short) {
|
||||
if(instance->last_level != level) {
|
||||
instance->last_level = (level ? true : false);
|
||||
|
||||
@@ -56,6 +56,7 @@ void subghz_file_encoder_worker_add_level_duration(
|
||||
|
||||
bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, const char* strStart) {
|
||||
char* str1;
|
||||
int32_t temp_ds = 0;
|
||||
bool res = false;
|
||||
// Line sample: "RAW_Data: -1, 2, -2..."
|
||||
|
||||
@@ -72,7 +73,18 @@ bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, co
|
||||
|
||||
// Skip space
|
||||
str1 += 1;
|
||||
subghz_file_encoder_worker_add_level_duration(instance, atoi(str1));
|
||||
//
|
||||
temp_ds = atoi(str1);
|
||||
if((temp_ds < -1000000) || (temp_ds > 1000000)) {
|
||||
if(temp_ds > 0) {
|
||||
subghz_file_encoder_worker_add_level_duration(instance, (int32_t)100);
|
||||
} else {
|
||||
subghz_file_encoder_worker_add_level_duration(instance, (int32_t)-100);
|
||||
}
|
||||
//FURI_LOG_I("PARSE", "Number overflow - %d", atoi(str1));
|
||||
} else {
|
||||
subghz_file_encoder_worker_add_level_duration(instance, temp_ds);
|
||||
}
|
||||
}
|
||||
res = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user