From 67a54bded3665ac4e7c764b8e540a2115e75570c Mon Sep 17 00:00:00 2001 From: wangfq Date: Fri, 3 Jul 2026 08:29:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20ARMCC=20=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=94=99=E8=AF=AF=E5=92=8C=E8=AD=A6=E5=91=8A=20?= =?UTF-8?q?=E2=80=94=20=E5=A4=9A=E4=BD=99=E5=A4=A7=E6=8B=AC=E5=8F=B7/?= =?UTF-8?q?=E6=9C=AA=E5=BC=95=E7=94=A8=E5=8F=98=E9=87=8F/=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=E7=B1=BB=E5=9E=8B=E6=B7=B7=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #991: g_loop_states 初始化去多余括号 {{0}, {{{0}}}} → {0} - #177-D: 删除未引用的 _counter1_init - #188-D: 7处 at32_led_* 调用加 (led_type) 强转 --- .../at32f421_freertos_demo/src/TaskLoop.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c b/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c index a26001b..d1fb294 100644 --- a/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c +++ b/vd960Loop/utilities/at32f421_freertos_demo/src/TaskLoop.c @@ -19,7 +19,7 @@ const uint16_t SensTable_1[4] = {108, 72, 18, 9}; /*=========================================================================== * 全局状态 *===========================================================================*/ -Loop154_States g_loop_states = {{0}, {{{0}}}}; +Loop154_States g_loop_states = {0}; uint32_t g_sys_freq = 0; uint8_t g_input_div = 1; uint32_t g_safe_max_cnt = LC_HOLD_TIME; @@ -245,7 +245,6 @@ void TMR3_GLOBAL_IRQHandler(void) *===========================================================================*/ void TMR15_GLOBAL_IRQHandler(void) { - static uint16_t _counter1_init = 0; static uint8_t TM1cnt = 0; uint8_t i; @@ -401,7 +400,7 @@ void poll_green_led(Loop154_Unit *unit) uint8_t idx = unit->loop_num; if (unit->disconnect_active) { - at32_led_off(idx); + at32_led_off((led_type)idx); _slow_tick[idx] = 0; return; } @@ -410,16 +409,16 @@ void poll_green_led(Loop154_Unit *unit) _slow_tick[idx]++; if (_slow_tick[idx] >= GREEN_SLOW_HALF) { _slow_tick[idx] = 0; - at32_led_toggle(idx); + at32_led_toggle((led_type)idx); } return; } _slow_tick[idx] = 0; if (unit->loop_VD_FLAG) - at32_led_on(idx); + at32_led_on((led_type)idx); else - at32_led_off(idx); + at32_led_off((led_type)idx); } /*=========================================================================== @@ -527,7 +526,7 @@ void vd1_task_per_channel(Loop154_Unit *unit) if (unit->hold_time > 0) { unit->loop_VD_HOLD = 1; } - at32_led_on(unit->loop_num); + at32_led_on((led_type)unit->loop_num); if (!unit->SET_SAFE) { unit->LC_HOLD = 1; @@ -715,7 +714,7 @@ void led_indicator_task_function(void *pvParameters) if (unit->loop_LOOP_OK0 == 0) { if (led_step[i] % 2 == 0) { - at32_led_toggle(i); + at32_led_toggle((led_type)i); } if (unit->loop_stable) { unit->loop_LOOP_OK0 = 1; @@ -725,7 +724,7 @@ void led_indicator_task_function(void *pvParameters) if (led_step[i] > 16) { led_step[i] = 0; unit->loop_LOOP_OK0 = 1; - at32_led_off(i); + at32_led_off((led_type)i); } } }