mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Subghz counter editor refactor
This commit is contained in:
@@ -157,10 +157,14 @@ static bool subghz_protocol_kinggates_stylo_4k_gen_data(
|
||||
|
||||
// Check for OFEX (overflow experimental) mode
|
||||
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
|
||||
if((instance->generic.cnt + furi_hal_subghz_get_rolling_counter_mult()) > 0xFFFF) {
|
||||
instance->generic.cnt = 0;
|
||||
} else {
|
||||
instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult();
|
||||
// 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
|
||||
if((instance->generic.cnt + furi_hal_subghz_get_rolling_counter_mult()) > 0xFFFF) {
|
||||
instance->generic.cnt = 0;
|
||||
} else {
|
||||
instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if((instance->generic.cnt + 0x1) > 0xFFFF) {
|
||||
@@ -580,6 +584,11 @@ void subghz_protocol_decoder_kinggates_stylo_4k_get_string(void* context, FuriSt
|
||||
SubGhzProtocolDecoderKingGates_stylo_4k* instance = context;
|
||||
subghz_protocol_kinggates_stylo_4k_remote_controller(&instance->generic, instance->keystore);
|
||||
|
||||
// push protocol data to global variable
|
||||
subghz_block_generic_global.cnt_is_available = true;
|
||||
subghz_block_generic_global.cnt_lenght_bit = 16;
|
||||
subghz_block_generic_global.current_cnt = instance->generic.cnt;
|
||||
|
||||
furi_string_cat_printf(
|
||||
output,
|
||||
"%s\r\n"
|
||||
|
||||
Reference in New Issue
Block a user