Skip to content

Commit af7bd1c

Browse files
committed
Fix two?
3 left
1 parent f0c1706 commit af7bd1c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/subghz/protocols/gangqi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,20 @@ static void subghz_protocol_encoder_gangqi_get_upload(SubGhzProtocolEncoderGangQ
106106

107107
size_t index = 0;
108108

109+
// Add initial GAP
110+
instance->encoder.upload[index++] =
111+
level_duration_make(false, (uint32_t)subghz_protocol_gangqi_const.te_long * 2);
112+
109113
// Send key and GAP between parcels
110114
for(uint8_t i = instance->generic.data_count_bit; i > 0; i--) {
111115
if(bit_read(instance->generic.data, i - 1)) {
112116
// Send bit 1
113117
instance->encoder.upload[index++] =
114118
level_duration_make(true, (uint32_t)subghz_protocol_gangqi_const.te_long);
115119
if(i == 1) {
116-
//Send gap if bit was last
120+
// Send final gap after last bit
117121
instance->encoder.upload[index++] = level_duration_make(
118-
false,
119-
(uint32_t)subghz_protocol_gangqi_const.te_short * 4 +
120-
subghz_protocol_gangqi_const.te_delta);
122+
false, (uint32_t)subghz_protocol_gangqi_const.te_short * 4);
121123
} else {
122124
instance->encoder.upload[index++] =
123125
level_duration_make(false, (uint32_t)subghz_protocol_gangqi_const.te_short);
@@ -127,11 +129,9 @@ static void subghz_protocol_encoder_gangqi_get_upload(SubGhzProtocolEncoderGangQ
127129
instance->encoder.upload[index++] =
128130
level_duration_make(true, (uint32_t)subghz_protocol_gangqi_const.te_short);
129131
if(i == 1) {
130-
//Send gap if bit was last
132+
// Send final gap after last bit
131133
instance->encoder.upload[index++] = level_duration_make(
132-
false,
133-
(uint32_t)subghz_protocol_gangqi_const.te_short * 4 +
134-
subghz_protocol_gangqi_const.te_delta);
134+
false, (uint32_t)subghz_protocol_gangqi_const.te_short * 4);
135135
} else {
136136
instance->encoder.upload[index++] =
137137
level_duration_make(false, (uint32_t)subghz_protocol_gangqi_const.te_long);

lib/subghz/protocols/marantec24.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ static void
9696
furi_assert(instance);
9797
size_t index = 0;
9898

99+
// Send initial GAP to trigger decoder
100+
instance->encoder.upload[index++] =
101+
level_duration_make(false, (uint32_t)subghz_protocol_marantec24_const.te_long * 9);
102+
99103
// Send key and GAP
100104
for(uint8_t i = instance->generic.data_count_bit; i > 0; i--) {
101105
if(bit_read(instance->generic.data, i - 1)) {
@@ -105,9 +109,7 @@ static void
105109
if(i == 1) {
106110
//Send gap if bit was last
107111
instance->encoder.upload[index++] = level_duration_make(
108-
false,
109-
(uint32_t)subghz_protocol_marantec24_const.te_long * 9 +
110-
subghz_protocol_marantec24_const.te_short);
112+
false, (uint32_t)subghz_protocol_marantec24_const.te_long * 9);
111113
} else {
112114
instance->encoder.upload[index++] = level_duration_make(
113115
false, (uint32_t)subghz_protocol_marantec24_const.te_long * 2);
@@ -119,9 +121,7 @@ static void
119121
if(i == 1) {
120122
//Send gap if bit was last
121123
instance->encoder.upload[index++] = level_duration_make(
122-
false,
123-
(uint32_t)subghz_protocol_marantec24_const.te_long * 9 +
124-
subghz_protocol_marantec24_const.te_short);
124+
false, (uint32_t)subghz_protocol_marantec24_const.te_long * 9);
125125
} else {
126126
instance->encoder.upload[index++] = level_duration_make(
127127
false, (uint32_t)subghz_protocol_marantec24_const.te_short * 3);

0 commit comments

Comments
 (0)