summaryrefslogtreecommitdiff
path: root/menus.c
diff options
context:
space:
mode:
Diffstat (limited to 'menus.c')
-rw-r--r--menus.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/menus.c b/menus.c
index 8d45e33..cf3aabb 100644
--- a/menus.c
+++ b/menus.c
@@ -1083,7 +1083,6 @@ 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)
{
gchar *units = NULL;
- int show_plus_sign;
int channel;
char LCD_string[LCD_cols+1];
@@ -1092,6 +1091,8 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch
channel=Show_What%100;
if (Show_What!=Show_No_Number) {
+ int show_plus_sign;
+
switch (Show_What-channel) {
case Show_frequency:
Submenu_Value=globals.ChannelState[channel].frequency;
@@ -1242,14 +1243,8 @@ static void Display_Number_on_LCD(int Is_Item_Visible,int LCD_row,int LCD_col,ch
static void Submenu_Display(int redraw)
{
gchar *title = NULL;
- char mode_name[Submenu_maximum_entries][LCD_col_width+1];
int i;
- int j;
int channel;
- int current_operating_mode;
- int add_spaces;
-
- current_operating_mode=0;
// FIXME - check for redundant clearing
if ( (globals.MenuStatus.Type_Of_Menu != Submenu_On) ||
@@ -1664,6 +1659,9 @@ static void Submenu_Display(int redraw)
LCD_write(3,0,Press_Change_Message);
if (Submenu_max_entry>0) {
+ char mode_name[Submenu_maximum_entries][LCD_col_width+1];
+ int current_operating_mode = 0;
+
LCD_write(0,19,"Mode:");
for (i=0; i<=Submenu_max_entry; ++i) {
@@ -2063,7 +2061,10 @@ static void Submenu_Display(int redraw)
}
for (i=base_entry; ( (i<=Submenu_max_entry) && (i< (base_entry+4)) ); ++i) {
+ int add_spaces, j;
+
add_spaces=LCD_col_width-strlen(mode_name[i]);
+
for (j=0; j<add_spaces; j++) {
strcat(mode_name[i]," ");
}
@@ -2819,9 +2820,6 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
int new_button_state;
- int chan;
- int outputs_turned_off;
-
/* read the button data */
new_button_state = I2C_Read(PCF8574A+Button_Press_Port);
@@ -2869,8 +2867,9 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
|| !(*button_port_val & Overload_Input) ) {
/* disable all outputs immediately */
- outputs_turned_off = 0;
+ int outputs_turned_off = 0;
if (globals.Flash.on_off_used) {
+ int chan;
for (chan=0; chan<(globals.Flash.ChanKey_output_state?globals.Flash.channels:1); ++chan) {
if (globals.ChannelState[chan].output_state == output_on) {
++outputs_turned_off;
@@ -2898,7 +2897,6 @@ static void Read_Keypad(int *button_port_val, int *upper_encoder_val, int *lower
GSourceFunc Menu_Check_Buttons(void)
{
- int error_num;
int button_port_val;
int upper_encoder_val;
int lower_encoder_val;
@@ -2931,6 +2929,7 @@ GSourceFunc Menu_Check_Buttons(void)
} else if (globals.MenuStatus.Type_Of_Menu==Main_Menu_On && globals.MenuStatus.Error_Screen==NO) {
Submenu_Display(NO);
} else if (globals.MenuStatus.Type_Of_Menu==Submenu_On && globals.MenuStatus.Error_Screen==NO) {
+ int error_num;
if (error_num=Submenu_Implement_Changes()) {
queue_error_and_display_on_LCD(error_num);
}