mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge remote-tracking branch 'ul/dev' into mntm-dev --nobuild
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user