summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:26:13 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:26:13 +0900
commit47965bf605cea2f6ebbcbbdd8ec2563fad09dd1d (patch)
treef81b5707cb5239cbafe4df47a6adb1d201f73e48
parent6a0f514e2a26cc698b8afbb156928a2a92b8161b (diff)
Simplify needlessly complex error handling when adjusting encoder
-rw-r--r--menus.c56
1 files changed, 14 insertions, 42 deletions
diff --git a/menus.c b/menus.c
index 7c3bcb5..dbe9bff 100644
--- a/menus.c
+++ b/menus.c
@@ -2569,9 +2569,7 @@ static void Submenu_Service_Encoder(int encoder_change)
if (globals.Flash.min_freq[channel]==globals.Flash.max_freq[channel]) {
return;
}
- if (error_num=Set_frequency(0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_frequency(0,0,0,channel,new_value);
break;
case Show_delay:
@@ -2602,9 +2600,7 @@ static void Submenu_Service_Encoder(int encoder_change)
}
}
- if (error_num=Set_Delay(0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Delay(0,0,0,channel,new_value);
break;
case Show_pw:
@@ -2635,39 +2631,27 @@ static void Submenu_Service_Encoder(int encoder_change)
}
}
- if (error_num=Set_Pw(0,0,0,channel,new_value,0)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Pw(0,0,0,channel,new_value,0);
break;
case Show_Burst_Time:
- if (error_num=Set_Burst_Time(0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Burst_Time(0,0,0,channel,new_value);
break;
case Show_rise_time:
- if (error_num=Set_rise_time(0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_rise_time(0,0,0,channel,new_value);
break;
case Show_slew:
- if (error_num=Set_slew(0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_slew(0,0,0,channel,new_value);
break;
case Show_load_type:
- if (error_num=Set_Load(channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Load(channel,new_value);
break;
case Show_soft_current_limit:
- if (error_num=Set_current_limit(0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_current_limit(0,channel,new_value);
break;
case Show_amplitude:
@@ -2697,9 +2681,7 @@ static void Submenu_Service_Encoder(int encoder_change)
}
- if (error_num=Set_Amplitude(0,0,0,0,0,0,0,channel,new_value,0)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Amplitude(0,0,0,0,0,0,0,channel,new_value,0);
break;
case Show_offset:
@@ -2714,15 +2696,11 @@ static void Submenu_Service_Encoder(int encoder_change)
}
}
- if (error_num=Set_Offset(0,0,0,0,channel,new_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Offset(0,0,0,0,channel,new_value);
break;
case Show_duty_cycle:
- if (error_num=Set_Pw(0,0,0,channel,new_value/(100*globals.ChannelState[channel].frequency),0)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Pw(0,0,0,channel,new_value/(100*globals.ChannelState[channel].frequency),0);
break;
case Show_gpib_address:
@@ -2731,21 +2709,15 @@ static void Submenu_Service_Encoder(int encoder_change)
break;
case Show_Burst_Count:
- if (error_num=Set_Burst_Count(channel,new_int_value,globals.ChannelState[channel].burst_time)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Burst_Count(channel,new_int_value,globals.ChannelState[channel].burst_time);
break;
case Show_route_primary:
- if (error_num=Set_Route(channel,ROUTE_PRIMARY,new_int_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Route(channel,ROUTE_PRIMARY,new_int_value);
break;
case Show_route_secondary:
- if (error_num=Set_Route(channel,ROUTE_SECONDARY,new_int_value)) {
- Submenu_Value=new_value;
- }
+ error_num=Set_Route(channel,ROUTE_SECONDARY,new_int_value);
break;
}