Inter-frame timeout fix

This commit is contained in:
assasinfil 2023-01-19 18:04:03 +03:00
parent 3dd76f5c2f
commit c6e30a1ed9
No known key found for this signature in database
GPG key ID: E5C793A4B4737A16

View file

@ -284,6 +284,15 @@ static bool subghz_protocol_encoder_somfy_keytis_get_upload(
}
}
//Inter-frame silence
if(instance->encoder.upload[index - 1].level == LEVEL_DURATION_LEVEL_LOW) {
instance->encoder.upload[index - 1].duration +=
(uint32_t)subghz_protocol_somfy_keytis_const.te_short * 3;
} else {
instance->encoder.upload[index++] =
level_duration_make(false, (uint32_t)subghz_protocol_somfy_keytis_const.te_short * 3);
}
for(uint8_t i = 0; i < 2; ++i) {
//Hardware sync
for(uint8_t i = 0; i < 6; ++i) {
@ -353,13 +362,18 @@ static bool subghz_protocol_encoder_somfy_keytis_get_upload(
}
}
//Inter-frame silence
instance->encoder.upload[index++] =
level_duration_make(false, (uint32_t)subghz_protocol_somfy_keytis_const.te_short);
if(instance->encoder.upload[index - 1].level == LEVEL_DURATION_LEVEL_LOW) {
instance->encoder.upload[index - 1].duration +=
(uint32_t)subghz_protocol_somfy_keytis_const.te_short * 3;
} else {
instance->encoder.upload[index++] = level_duration_make(
false, (uint32_t)subghz_protocol_somfy_keytis_const.te_short * 3);
}
}
//Inter-frame silence
instance->encoder.upload[index++] =
level_duration_make(false, (uint32_t)subghz_protocol_somfy_keytis_const.te_long);
instance->encoder.upload[index - 1].duration +=
(uint32_t)30415 - (uint32_t)subghz_protocol_somfy_keytis_const.te_short * 3;
size_t size_upload = index;