mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-07 19:01:54 -07:00
finish
This commit is contained in:
@@ -12,6 +12,9 @@
|
||||
#define SUBGHZ_NO_ALUTECH_AT_4N_RAINBOW_TABLE 0xFFFFFFFFFFFFFFFF
|
||||
#define SUBGHZ_ALUTECH_AT_4N_RAINBOW_TABLE_SIZE_BYTES 32
|
||||
|
||||
//variable used to bypass CounterMode settings if user just change Counter or Button
|
||||
static bool bypass = false;
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_alutech_at_4n_const = {
|
||||
.te_short = 400,
|
||||
.te_long = 800,
|
||||
@@ -293,11 +296,13 @@ static bool subghz_protocol_alutech_at_4n_gen_data(
|
||||
instance->generic.serial = (uint32_t)(data >> 24) & 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
// if we change counter in SignalSettings menu then we must passthru counter_modes, just gen and save signal file.
|
||||
if((alutech_at4n_counter_mode == 0) || subghz_block_generic_global.cnt_need_override) {
|
||||
// if we change counter/button in SignalSettings menu then we must bypass counter_modes, just gen and save signal file.
|
||||
if(subghz_block_generic_global.cnt_need_override) bypass = true;
|
||||
|
||||
if((alutech_at4n_counter_mode == 0) || bypass) {
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if((furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) ||
|
||||
subghz_block_generic_global.cnt_need_override) {
|
||||
if((furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) || bypass) {
|
||||
bypass = false;
|
||||
// standart counter mode. PULL data from subghz_block_generic_global variables
|
||||
if(!subghz_block_generic_global_counter_override_get(&instance->generic.cnt)) {
|
||||
// if counter_override_get return FALSE then counter was not changed and we increase counter by standart mult value
|
||||
@@ -403,8 +408,10 @@ static bool subghz_protocol_encoder_alutech_at_4n_get_upload(
|
||||
btn = subghz_protocol_alutech_at_4n_get_btn_code();
|
||||
|
||||
// override button if we change it with signal settings button editor
|
||||
if(subghz_block_generic_global_button_override_get(&btn))
|
||||
if(subghz_block_generic_global_button_override_get(&btn)) {
|
||||
bypass = true;
|
||||
FURI_LOG_D(TAG, "Button sucessfully changed to 0x%X", btn);
|
||||
}
|
||||
|
||||
// Gen new key
|
||||
if(!subghz_protocol_alutech_at_4n_gen_data(instance, btn)) {
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
|
||||
#define TAG "SubGhzProtocoCameAtomo"
|
||||
|
||||
//variable used to bypass CounterMode settings if user just change Counter or Button
|
||||
static bool bypass = false;
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_came_atomo_const = {
|
||||
.te_short = 600,
|
||||
.te_long = 1200,
|
||||
@@ -187,9 +190,15 @@ static void subghz_protocol_encoder_came_atomo_get_upload(
|
||||
|
||||
uint8_t pack[8] = {};
|
||||
|
||||
if(came_atomo_counter_mode == 0) {
|
||||
// if we change counter/button in SignalSettings menu then we must bypass counter_modes, just gen and save signal file.
|
||||
if(subghz_block_generic_global.cnt_need_override ||
|
||||
subghz_block_generic_global.btn_need_override)
|
||||
bypass = true;
|
||||
|
||||
if(came_atomo_counter_mode == 0 || bypass) {
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF || bypass) {
|
||||
bypass = false;
|
||||
// standart counter mode. PULL data from subghz_block_generic_global variables
|
||||
if(!subghz_block_generic_global_counter_override_get(&instance->generic.cnt)) {
|
||||
// if counter_override_get return FALSE then counter was not changed and we increase counter by standart mult value
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
#define TAG "SubGhzProtocolKeeloq"
|
||||
|
||||
//variable used to bypass CounterMode settings if user just change Counter or Button
|
||||
static bool bypass = false;
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_keeloq_const = {
|
||||
.te_short = 400,
|
||||
.te_long = 800,
|
||||
@@ -241,9 +244,10 @@ static bool subghz_protocol_keeloq_gen_data(
|
||||
if(counter_up && prog_mode == PROG_MODE_OFF) {
|
||||
// Counter increment conditions
|
||||
|
||||
if(keeloq_counter_mode == 0) {
|
||||
if(keeloq_counter_mode == 0 || bypass) {
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF || bypass) {
|
||||
bypass = false;
|
||||
// standart counter mode. PULL data from subghz_block_generic_global variables
|
||||
if(!subghz_block_generic_global_counter_override_get(&instance->generic.cnt)) {
|
||||
// if counter_override_get return FALSE then counter was not changed and we increase counter by standart mult value
|
||||
@@ -601,7 +605,13 @@ static bool
|
||||
instance->encoder.size_upload = 0;
|
||||
size_t upindex = 0;
|
||||
|
||||
if(keeloq_counter_mode == 7) {
|
||||
// if we change counter/button in SignalSettings menu then we must bypass counter_modes, just gen and save signal file.
|
||||
if(subghz_block_generic_global.cnt_need_override ||
|
||||
subghz_block_generic_global.btn_need_override)
|
||||
bypass = true;
|
||||
|
||||
// Create mode7 upload only if counter and button was not changed by SignalSettings menu
|
||||
if(keeloq_counter_mode == 7 && !bypass) {
|
||||
uint16_t temp_cnt = instance->generic.cnt;
|
||||
instance->encoder.repeat = 1;
|
||||
for(uint8_t i = 7; i > 0; i--) {
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#define SUBGHZ_NICE_FLOR_S_RAINBOW_TABLE_SIZE_BYTES 32
|
||||
#define SUBGHZ_NO_NICE_FLOR_S_RAINBOW_TABLE 0
|
||||
|
||||
//variable used to bypass CounterMode settings if user just change Counter or Button
|
||||
static bool bypass = false;
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_nice_flor_s_const = {
|
||||
.te_short = 500,
|
||||
.te_long = 1000,
|
||||
@@ -148,8 +151,10 @@ static void subghz_protocol_encoder_nice_flor_s_get_upload(
|
||||
btn = subghz_protocol_nice_flor_s_get_btn_code();
|
||||
|
||||
// override button if we change it with signal settings button editor
|
||||
if(subghz_block_generic_global_button_override_get(&btn))
|
||||
if(subghz_block_generic_global_button_override_get(&btn)) {
|
||||
bypass = true;
|
||||
FURI_LOG_D(TAG, "Button sucessfully changed to 0x%X", btn);
|
||||
}
|
||||
|
||||
size_t size_upload = ((instance->generic.data_count_bit * 2) + ((37 + 2 + 2) * 2) * 16);
|
||||
if(size_upload > instance->encoder.size_upload) {
|
||||
@@ -157,9 +162,14 @@ static void subghz_protocol_encoder_nice_flor_s_get_upload(
|
||||
} else {
|
||||
instance->encoder.size_upload = size_upload;
|
||||
}
|
||||
if(nice_flors_counter_mode == 0) {
|
||||
|
||||
// if we change counter/button in SignalSettings menu then we must bypass counter_modes, just gen and save signal file.
|
||||
if(subghz_block_generic_global.cnt_need_override) bypass = true;
|
||||
|
||||
if(nice_flors_counter_mode == 0 || bypass) {
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF || bypass) {
|
||||
bypass = false;
|
||||
// standart counter mode. PULL data from subghz_block_generic_global variables
|
||||
if(!subghz_block_generic_global_counter_override_get(&instance->generic.cnt)) {
|
||||
// if counter_override_get return FALSE then counter was not changed and we increase counter by standart mult value
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
#define TAG "SubGhzProtocolPhoenixV2"
|
||||
|
||||
//variable used to bypass CounterMode settings if user just change Counter or Button
|
||||
static bool bypass = false;
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_phoenix_v2_const = {
|
||||
.te_short = 427,
|
||||
.te_long = 853,
|
||||
@@ -256,13 +259,19 @@ static bool
|
||||
btn = subghz_protocol_phoenix_v2_get_btn_code();
|
||||
|
||||
// override button if we change it with signal settings button editor
|
||||
if(subghz_block_generic_global_button_override_get(&btn))
|
||||
if(subghz_block_generic_global_button_override_get(&btn)) {
|
||||
bypass = true;
|
||||
FURI_LOG_D(TAG, "Button sucessfully changed to 0x%X", btn);
|
||||
}
|
||||
|
||||
// Reconstruction of the data
|
||||
if(v2_phoenix_counter_mode == 0) {
|
||||
// if we change counter/button in SignalSettings menu then we must bypass counter_modes, just gen and save signal file.
|
||||
if(subghz_block_generic_global.cnt_need_override) bypass = true;
|
||||
|
||||
if(v2_phoenix_counter_mode == 0 || bypass) {
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF || bypass) {
|
||||
bypass = false;
|
||||
// standart counter mode. PULL data from subghz_block_generic_global variables
|
||||
if(!subghz_block_generic_global_counter_override_get(&instance->generic.cnt)) {
|
||||
// if counter_override_get return FALSE then counter was not changed and we increase counter by standart mult value
|
||||
|
||||
Reference in New Issue
Block a user