Merge remote-tracking branch 'ul/dev' into mntm-dev --nobuild

This commit is contained in:
WillyJL
2025-12-20 23:48:35 +01:00
16 changed files with 218 additions and 182 deletions

View File

@@ -149,19 +149,14 @@ static void subghz_protocol_encoder_hay21_get_upload(SubGhzProtocolEncoderHay21*
// Counter increment
// Check for OFEX (overflow experimental) mode
if(furi_hal_subghz_get_rolling_counter_mult() != -0x7FFFFFFF) {
if(instance->generic.cnt < 0xF) {
if((instance->generic.cnt + furi_hal_subghz_get_rolling_counter_mult()) > 0xF) {
instance->generic.cnt = 0;
} else {
instance->generic.cnt += furi_hal_subghz_get_rolling_counter_mult();
}
if(furi_hal_subghz_get_rolling_counter_mult() >= 0xF) {
instance->generic.cnt = 0xF;
}
} else if(instance->generic.cnt >= 0xF) {
//not matter how big and long mult - we take only 4 bits ( AND 0xF) beacose hay21 counter have only 4 bits long (0..F)
if((instance->generic.cnt + (furi_hal_subghz_get_rolling_counter_mult() & 0xF)) > 0xF) {
instance->generic.cnt = 0;
} else {
instance->generic.cnt += (furi_hal_subghz_get_rolling_counter_mult() & 0xF);
}
} else {
// OFEX mode
if((instance->generic.cnt + 0x1) > 0xF) {
instance->generic.cnt = 0;
} else if(instance->generic.cnt >= 0x1 && instance->generic.cnt != 0xE) {