Commit 19bc2499 authored by 李冠华's avatar 李冠华

🦄 refactor:优化刀盘挡位显示逻辑

parent fa1bbec1
...@@ -55,32 +55,13 @@ void Gauge_Cutterhead_Gear_Display(void) ...@@ -55,32 +55,13 @@ void Gauge_Cutterhead_Gear_Display(void)
{ {
uint8_t CutterheadValue = Get_Gear_Cutterhead_Value(); uint8_t CutterheadValue = Get_Gear_Cutterhead_Value();
uint8_t CutterheadValid = Get_Gear_Cutterhead_Valid(); uint8_t CutterheadValid = Get_Gear_Cutterhead_Valid();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if (CutterheadValid == 2U) if (CutterheadValid == 2U)
{ {
if (CutterheadValue > 0U) if (FLASH_SYNC_1Hz)
{
if (FLASH_SYNC_1Hz)
{
SEG_SET_Cutterhead(1, CutterheadValue, 0);
}
else
{
SEG_SET_Cutterhead(1, 4, 0);
}
}
else
{
SEG_SET_Cutterhead(1, 4, 0);
}
}
else if (CutterheadValid == 1U)
{
if (CutterheadValue > 0U)
{ {
SEG_SET_Cutterhead(1, CutterheadValue, 0); SEG_SET_Cutterhead(1, CutterheadValue, 0);
} }
else else
{ {
SEG_SET_Cutterhead(1, 4, 0); SEG_SET_Cutterhead(1, 4, 0);
...@@ -88,7 +69,7 @@ void Gauge_Cutterhead_Gear_Display(void) ...@@ -88,7 +69,7 @@ void Gauge_Cutterhead_Gear_Display(void)
} }
else else
{ {
SEG_SET_Cutterhead(0, 0, 0); SEG_SET_Cutterhead(CutterheadValid, CutterheadValue, 0);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment