fix: 修复 ARMCC 编译错误和警告 — 多余大括号/未引用变量/枚举类型混用

- #991: g_loop_states 初始化去多余括号 {{0}, {{{0}}}} → {0}
- #177-D: 删除未引用的 _counter1_init
- #188-D: 7处 at32_led_* 调用加 (led_type) 强转
This commit is contained in:
wangfq
2026-07-03 08:29:30 +08:00
parent 9e125f953c
commit 67a54bded3

View File

@@ -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);
}
}
}