diff options
-rw-r--r-- | menus.c | 64 | ||||
-rw-r--r-- | parser.c | 18 |
2 files changed, 64 insertions, 18 deletions
@@ -129,8 +129,12 @@ #define mode_network 7200 #define mode_password 7300 #define mode_selfcal 7400 +#define mode_19200 7500 +#define mode_38400 7600 +#define mode_57600 7700 +#define mode_115200 7800 -#define Submenu_maximum_entries 8 /* used to be 4, before scrolling lists were added */ +#define Submenu_maximum_entries 10 /* used to be 4, before scrolling lists were added */ /* what parameter to adjust */ #define Show_frequency 0 @@ -1574,13 +1578,18 @@ static void Submenu_Display(int change_selection) case Submenu2_rs232_baud: title = g_strdup ("Baud Rate:"); - Submenu_max_entry=3; + Submenu_max_entry=7; // FIXME: generate structure from valid baud rate list Submenu_Structure[0]=mode_1200; Submenu_Structure[1]=mode_2400; Submenu_Structure[2]=mode_4800; Submenu_Structure[3]=mode_9600; + Submenu_Structure[4]=mode_19200; + Submenu_Structure[5]=mode_38400; + Submenu_Structure[6]=mode_57600; + Submenu_Structure[7]=mode_115200; + break; case Submenu2_rs232_stopbits: @@ -1960,6 +1969,31 @@ static void Submenu_Display(int change_selection) current_operating_mode=i; } break; + case mode_19200: + strcpy(mode_name[i],"19200 baud"); + if (globals.Flash.baud==19200) { + current_operating_mode=i; + } + break; + case mode_38400: + strcpy(mode_name[i],"38400 baud"); + if (globals.Flash.baud==38400) { + current_operating_mode=i; + } + break; + case mode_57600: + strcpy(mode_name[i],"57600 baud"); + if (globals.Flash.baud==57600) { + current_operating_mode=i; + } + break; + case mode_115200: + strcpy(mode_name[i],"115200 baud"); + if (globals.Flash.baud==115200) { + current_operating_mode=i; + } + break; + case mode_1bit: strcpy(mode_name[i],"1 bit"); if (globals.Flash.stopbits==1) { @@ -3239,7 +3273,6 @@ static int Submenu_Implement_Changes(void) globals.MenuStatus.Selected_Submenu=Submenu1_setup; break; case mode_1200: - // FIXME: check that serial menus actually work IO_Setup_RS232(1200, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE); globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits; call_new_submenu=YES; @@ -3263,6 +3296,31 @@ static int Submenu_Implement_Changes(void) call_new_submenu=YES; Submenu_Display(NO); break; + case mode_19200: + IO_Setup_RS232(19200, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE); + globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits; + call_new_submenu=YES; + Submenu_Display(NO); + break; + case mode_38400: + IO_Setup_RS232(38400, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE); + globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits; + call_new_submenu=YES; + Submenu_Display(NO); + break; + case mode_57600: + IO_Setup_RS232(57600, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE); + globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits; + call_new_submenu=YES; + Submenu_Display(NO); + break; + case mode_115200: + IO_Setup_RS232(115200, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE); + globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits; + call_new_submenu=YES; + Submenu_Display(NO); + break; + case mode_1bit: IO_Setup_RS232(globals.Flash.baud, 1, globals.Flash.hardhand, globals.Flash.echo, FALSE); globals.MenuStatus.Selected_Submenu=Submenu2_rs232_hardhand; @@ -36,7 +36,6 @@ static int process_int_param (char *parameter, int *value, int item_count, int * static int process_int_range (char *parameter, int *value, int min_val, int max_val); static int process_on_off (char *parameter, int *value); static int process_two_ints (char *parameter, int *value, int min, int max); -static int process_four_ints (char *parameter, int *value, int v1, int v2, int v3, int v4); static int check_channel_ok (int channel, int enabled_channels, char chankey); static int Parser_id_word(char *id_me, int *channel, int *with_id_code); @@ -91,8 +90,6 @@ static int Go_zout_20(gchar** response, int channel, char *parameter,char *units static int Go_prot_trip_21(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_gpib_addr_59(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_ser_baud_60(gchar** response, int channel, char *parameter,char *units,int command_type); -static int Go_ser_par_61(gchar** response, int channel, char *parameter,char *units,int command_type); -static int Go_ser_bits_62(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_ser_sbits_63(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_ser_rts_64(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_ser_echo_65(gchar** response, int channel, char *parameter,char *units,int command_type); @@ -1617,12 +1614,6 @@ static int process_two_ints (char *parameter, int *value, int min, int max) return process_int_param (parameter, value, 2, valid_choices, NO_ON_OFF); } -static int process_four_ints (char *parameter, int *value, int v1, int v2, int v3, int v4) -{ - int valid_choices[4] = {v1, v2, v3, v4}; - return process_int_param (parameter, value, 4, valid_choices, NO_ON_OFF); -} - static int check_channel_ok (int channel, int enabled_channels, char chankey) { /* how many channels overall */ @@ -2733,13 +2724,11 @@ static int Go_gpib_addr_59(gchar** response, int channel, char *parameter,char * static int Go_ser_baud_60(gchar** response, int channel, char *parameter,char *units,int command_type) { int new_baud, status; - int valid_choices[] = {1200, 2400, 4800, 9600}; + int valid_choices[] = {1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}; switch (command_type) { case command_withparam: - // FIXME - expand this list - // FIXME - hardcoded "4" - if (status = process_int_param (parameter, &new_baud, 4, valid_choices, NO_ON_OFF)) { + if (status = process_int_param (parameter, &new_baud, 8, valid_choices, NO_ON_OFF)) { return status; } return IO_Setup_RS232(new_baud, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, TRUE); @@ -2750,8 +2739,7 @@ static int Go_ser_baud_60(gchar** response, int channel, char *parameter,char *u break; case query_param: - // FIXME - extract min, max from a new baud list - return query_min_max_int (response, parameter, 1200, 9600); + return query_min_max_int (response, parameter, 1200, 115200); break; default: |