From 5ff42898f157d31baa91bf42922df87c4ca889ec Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 02:27:46 +0900 Subject: fix encoder clearing --- menus.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/menus.c b/menus.c index 52c6c3f..3de5af3 100644 --- a/menus.c +++ b/menus.c @@ -2323,13 +2323,13 @@ static void Submenu_Service_Encoder(int encoder_change) } if (globals.MenuStatus.Type_Of_Menu==Main_Menu_On) { - if (encoder_change>1) { + if (encoder_change>0) { Menu_Move_Pointer(1); - } else if (encoder_change<-1) { + } else { Menu_Move_Pointer(-1); } - g_usleep(2e5); + Menu_Clear_Buttons(TRUE); return; } @@ -2918,6 +2918,7 @@ void Menu_Check_Buttons(void) } } } + Menu_Clear_Buttons(TRUE); } else if (!(button_port_val & Move_Button)) { /* ----- MOVE BUTTON ----------- */ /* MOVE button hit, move pointer */ if (globals.MenuStatus.Type_Of_Menu==Main_Menu_On && globals.MenuStatus.Nonstd_Display==NO && globals.MenuStatus.Error_Screen==NO) { @@ -2925,6 +2926,7 @@ void Menu_Check_Buttons(void) } else if (globals.MenuStatus.Type_Of_Menu==Submenu_On && globals.MenuStatus.Nonstd_Display==NO && globals.MenuStatus.Error_Screen==NO) { Submenu_Move_Pointer(); } + Menu_Clear_Buttons(TRUE); } else if (!(button_port_val & Mult10_Button)) { /* ----- X10 BUTTON ------------ */ if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { @@ -2932,6 +2934,7 @@ void Menu_Check_Buttons(void) } queue_error_and_display_on_LCD(Submenu_Mult_Value(10.0)); } + Menu_Clear_Buttons(TRUE); } else if (!(button_port_val & Div10_Button)) { /* ----- /10 BUTTON ------------ */ if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { @@ -2939,6 +2942,7 @@ void Menu_Check_Buttons(void) } queue_error_and_display_on_LCD(Submenu_Mult_Value(0.1)); } + Menu_Clear_Buttons(TRUE); } else if (!(button_port_val & Plus_Minus_Button)) { /* ----- +/- BUTTON ------------ */ if (globals.MenuStatus.Type_Of_Menu==Submenu_On && !VXI_OR_GPIB_LOCK_ACTIVE) { if (globals.MenuStatus.Error_Screen==YES) { @@ -2946,6 +2950,7 @@ void Menu_Check_Buttons(void) } queue_error_and_display_on_LCD(Submenu_Mult_Value(-1.0)); } + Menu_Clear_Buttons(TRUE); } else if (!(button_port_val & Extra_Fine_Button)) { /* ----- EXTRA FINE BUTTON ----- */ if (globals.MenuStatus.Type_Of_Menu==Submenu_On && globals.MenuStatus.Nonstd_Display==NO && globals.MenuStatus.Error_Screen==NO && !VXI_OR_GPIB_LOCK_ACTIVE) { if (Submenu_extra_fine==YES) { @@ -2958,6 +2963,7 @@ void Menu_Check_Buttons(void) LCD_write(2,2,"(extra fine adjust)"); } } + Menu_Clear_Buttons(TRUE); } /* if none of the buttons are pressed, it must be the encoder */ else if (encoder_change) { /* ----- ENCODER --------------- */ -- cgit