@@ -106,18 +106,20 @@ static void subghz_protocol_encoder_gangqi_get_upload(SubGhzProtocolEncoderGangQ
106
106
107
107
size_t index = 0 ;
108
108
109
+ // Add initial GAP
110
+ instance -> encoder .upload [index ++ ] =
111
+ level_duration_make (false, (uint32_t )subghz_protocol_gangqi_const .te_long * 2 );
112
+
109
113
// Send key and GAP between parcels
110
114
for (uint8_t i = instance -> generic .data_count_bit ; i > 0 ; i -- ) {
111
115
if (bit_read (instance -> generic .data , i - 1 )) {
112
116
// Send bit 1
113
117
instance -> encoder .upload [index ++ ] =
114
118
level_duration_make (true, (uint32_t )subghz_protocol_gangqi_const .te_long );
115
119
if (i == 1 ) {
116
- //Send gap if bit was last
120
+ // Send final gap after last bit
117
121
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 );
121
123
} else {
122
124
instance -> encoder .upload [index ++ ] =
123
125
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
127
129
instance -> encoder .upload [index ++ ] =
128
130
level_duration_make (true, (uint32_t )subghz_protocol_gangqi_const .te_short );
129
131
if (i == 1 ) {
130
- //Send gap if bit was last
132
+ // Send final gap after last bit
131
133
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 );
135
135
} else {
136
136
instance -> encoder .upload [index ++ ] =
137
137
level_duration_make (false, (uint32_t )subghz_protocol_gangqi_const .te_long );
0 commit comments