mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
SubGHz: Fix Came Atomo and NiceFlorS counters
add check for protocols with 16bit counters, to block them for going higher than 16bit
This commit is contained in:
@@ -135,7 +135,11 @@ static void
|
||||
|
||||
uint8_t pack[8] = {};
|
||||
|
||||
instance->generic.cnt++;
|
||||
if(instance->generic.cnt < 0xFFFF) {
|
||||
instance->generic.cnt++;
|
||||
} else if(instance->generic.cnt >= 0xFFFF) {
|
||||
instance->generic.cnt = 0;
|
||||
}
|
||||
|
||||
//Send header
|
||||
instance->encoder.upload[index++] =
|
||||
|
||||
@@ -129,7 +129,11 @@ static void subghz_protocol_encoder_nice_flor_s_get_upload(
|
||||
instance->encoder.size_upload = size_upload;
|
||||
}
|
||||
|
||||
instance->generic.cnt++;
|
||||
if(instance->generic.cnt < 0xFFFF) {
|
||||
instance->generic.cnt++;
|
||||
} else if(instance->generic.cnt >= 0xFFFF) {
|
||||
instance->generic.cnt = 0;
|
||||
}
|
||||
uint64_t decrypt = ((uint64_t)instance->generic.serial << 16) | instance->generic.cnt;
|
||||
uint64_t enc_part = subghz_protocol_nice_flor_s_encrypt(decrypt, file_name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user