summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-31 08:08:49 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-31 08:08:49 -0400
commitfae02b5c3a9d5f3cf3e6253cdcd6a0100bdbcd73 (patch)
treeb58a74d1532919b7111673e43cc075ca74747fbd
parent2519e80b677156ccc4327de1396f88e0097ac3cf (diff)
reduce scope of LCD_string
-rw-r--r--menus.c82
1 files changed, 28 insertions, 54 deletions
diff --git a/menus.c b/menus.c
index 607da32..036e4c2 100644
--- a/menus.c
+++ b/menus.c
@@ -198,8 +198,7 @@ int Submenu_extra_fine; /* is the extra-fine mode on? */
static int Menu_Is_Item_Visible(int LCD_entry);
static void Menu_Move_Pointer(int move_amount);
-static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,char *start_string,int Show_What,
- int significant_digits, int width_of_column,char *LCD_string);
+static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,char *start_string,int Show_What, int significant_digits, int width_of_column);
static void Submenu_Display(int redraw);
static void Submenu_Move_Pointer(void);
static int Submenu_Mult_Value(float mult_by);
@@ -237,7 +236,6 @@ void Menu_Update_Display(void)
int chan;
int show_item;
int old_cursor_pos;
- char LCD_string[LCD_cols+1];
LCD_entry=-1;
sig_dig = 4;
@@ -299,8 +297,7 @@ void Menu_Update_Display(void)
strcat(a_string,":");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_freq) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_freq) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1);
}
}
@@ -335,8 +332,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_func) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_func) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig,LCD_col_width-1);
}
}
@@ -367,8 +363,7 @@ void Menu_Update_Display(void)
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_delay) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_delay+chan,sig_dig-globals.Flash.ChanKey_delay,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_delay) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_delay+chan,sig_dig-globals.Flash.ChanKey_delay,LCD_col_width-1);
}
@@ -426,8 +421,7 @@ void Menu_Update_Display(void)
}
strcat(a_string,": DC");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_pw) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_pw,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_pw) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_pw,LCD_col_width-1);
}
}
@@ -456,8 +450,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_rise_time) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_rise_time,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_rise_time) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_rise_time,LCD_col_width-1);
}
}
@@ -499,8 +492,7 @@ void Menu_Update_Display(void)
}
strcat(a_string,":AMPLFY");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_amplitude,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_amplitude,LCD_col_width-1);
}
}
@@ -522,8 +514,7 @@ void Menu_Update_Display(void)
sprintf(b_string, "%d", chan+1);
strcat(a_string,b_string);
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-1,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_amp) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-1,LCD_col_width-1);
}
}
@@ -547,8 +538,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_soft_current_limit) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_current_limit,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_soft_current_limit) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_current_limit,LCD_col_width-1);
}
}
@@ -574,8 +564,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_slew) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_slew,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_slew) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_slew,LCD_col_width-1);
}
}
@@ -600,8 +589,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_count) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_count) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1);
}
}
@@ -627,8 +615,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_time) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_Burst_Time,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_burst_time) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_Burst_Time,LCD_col_width-1);
}
}
@@ -665,8 +652,7 @@ void Menu_Update_Display(void)
}
strcat(a_string,":EXT");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_os) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_offset,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_os) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_offset,LCD_col_width-1);
}
}
@@ -685,7 +671,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry),LCD_row,LCD_col,a_string,Show_monitor+chan,sig_dig-globals.Flash.ChanKey_Curr_Mon_value,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD(Menu_Is_Item_Visible(LCD_entry),LCD_row,LCD_col,a_string,Show_monitor+chan,sig_dig-globals.Flash.ChanKey_Curr_Mon_value,LCD_col_width-1);
globals.ChannelState[chan].displayed_mon_val=globals.ChannelState[chan].Curr_Mon_value;
}
}
@@ -721,8 +707,7 @@ void Menu_Update_Display(void)
}
g_free (temp);
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_zout) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_zout,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_zout) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_zout,LCD_col_width-1);
}
}
@@ -745,8 +730,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_load) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_load_type,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_load) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,sig_dig-globals.Flash.ChanKey_load_type,LCD_col_width-1);
}
}
@@ -777,8 +761,7 @@ void Menu_Update_Display(void)
strcat(a_string,"OFF");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_output) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_output_state,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_output) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_output_state,LCD_col_width-1);
}
/*----- display primary routing, as appropriate -----*/
@@ -807,8 +790,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1);
}
}
@@ -835,8 +817,7 @@ void Menu_Update_Display(void)
strcat(a_string,b_string);
}
strcat(a_string,":");
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_routes) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,show_item,0,LCD_col_width-1);
}
}
@@ -866,8 +847,7 @@ void Menu_Update_Display(void)
strcat(a_string,"YES");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_inv) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_polarity,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_inv) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_polarity,LCD_col_width-1);
}
}
@@ -895,8 +875,7 @@ void Menu_Update_Display(void)
strcat(a_string,"ECL");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_logic_level) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_logic_level,LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_logic_level) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number,sig_dig-globals.Flash.ChanKey_logic_level,LCD_col_width-1);
}
}
@@ -931,9 +910,7 @@ void Menu_Update_Display(void)
strcat(a_string,"ASY,HI");
}
- Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_gate) && Menu_Is_Item_Visible(LCD_entry),
- LCD_row,LCD_col,a_string,Show_No_Number,
- sig_dig-(globals.Flash.ChanKey_gate_level | globals.Flash.ChanKey_gate_type),LCD_col_width-1,LCD_string);
+ Display_Number_on_LCD((globals.Changes.update_whole_main_menu || globals.Changes.update_gate) && Menu_Is_Item_Visible(LCD_entry), LCD_row,LCD_col,a_string,Show_No_Number, sig_dig-(globals.Flash.ChanKey_gate_level | globals.Flash.ChanKey_gate_type),LCD_col_width-1);
}
}
@@ -1099,14 +1076,14 @@ static void Menu_Move_Pointer(int move_amount)
}
-static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,char *start_string,int Show_What,
- int significant_digits, int width_of_column,char *LCD_string)
+static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,char *start_string,int Show_What, int significant_digits, int width_of_column)
{
char units[10];
int show_plus_sign;
int i;
int channel;
+ char LCD_string[LCD_cols+1];
LCD_string[0]=0;
channel=Show_What%100;
@@ -1269,7 +1246,6 @@ static void Submenu_Display(int redraw)
int channel;
int current_operating_mode;
int add_spaces;
- char LCD_string[LCD_cols+1];
current_operating_mode=0;
@@ -1678,7 +1654,7 @@ static void Submenu_Display(int redraw)
}
LCD_write(0,0,title);
- Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width,LCD_string);
+ Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width);
LCD_write(3,0,Press_Change_Message);
if (Submenu_max_entry>0) {
@@ -2124,7 +2100,6 @@ static int Submenu_Mult_Value(float mult_by)
int error_num;
int channel;
- char LCD_string[LCD_cols+1];
float new_value;
@@ -2284,7 +2259,7 @@ static int Submenu_Mult_Value(float mult_by)
Main_update_shift_registers();
- Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width,LCD_string);
+ Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width);
return error_num;
}
@@ -2301,7 +2276,6 @@ static void Submenu_Service_Encoder(int encoder_change)
int new_int_value;
int reset_encoder;
int channel;
- char LCD_string[LCD_cols+1];
reset_encoder=YES;
@@ -2564,7 +2538,7 @@ static void Submenu_Service_Encoder(int encoder_change)
}
/* update display - correct later if required */
- Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width,LCD_string);
+ Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width);
switch ((Submenu_Numeric_Parameter-channel)) {
case Show_frequency:
@@ -2759,7 +2733,7 @@ static void Submenu_Service_Encoder(int encoder_change)
Main_update_shift_registers();
- Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width,LCD_string);
+ Display_Number_on_LCD(YES,1,2,"",Submenu_Numeric_Parameter,4,LCD_col_width);
queue_error_and_display_on_LCD(error_num);