From 1d3d9f4ff0d9626729ba0cf10dc558beeb10399e Mon Sep 17 00:00:00 2001 From: yuanchaowang Date: Tue, 2 Jul 2019 14:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=A3=8E=E5=90=91=E4=B8=AA?= =?UTF-8?q?=E6=95=B0=E4=B8=BA=E4=B8=A4=E4=BD=8D=E6=95=B0=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E4=B8=AA=E6=95=B0=E5=88=A4=E6=96=AD=E5=A4=B1=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ir_decoder/src/ir_ac_parse_parameter.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c b/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c index e5c8cea..01eb776 100644 --- a/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c +++ b/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c @@ -1099,6 +1099,8 @@ INT8 parse_function_2_tag34(struct tag_head *tag, t_function_2 *function2) INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) { + int i; + if (NULL == tag) { return IR_DECODE_FAILED; @@ -1135,8 +1137,16 @@ INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) * length greater than 1 indicates both auto-swing and some swing angles are supported */ // count how many swing types are there - si->type = SWING_TYPE_NORMAL; - si->mode_count = (UINT8) ((tag->len + 1) >> 1); + si->type = SWING_TYPE_NORMAL; + //si->mode_count = (UINT8) ((tag->len + 1) >> 1); + si->mode_count = 1; + for (i = 0; i < tag->len; i++) + { + if (tag->p_data[i] == ',') + { + si->mode_count++; + } + } return IR_DECODE_SUCCEEDED; }