mirror of
https://github.com/vivier/EMILE.git
synced 2025-04-04 09:29:31 +00:00
read_config_vga(), read_config_modem(), read_config_printer() read also the config file
This commit is contained in:
parent
f35017ae04
commit
01b51b602b
@ -195,36 +195,54 @@ static char *decode_serial(char* s, int *baudrate, int *parity, int *datasize, i
|
||||
return s;
|
||||
}
|
||||
|
||||
int read_config_vga(int8_t *conf)
|
||||
{
|
||||
char property[64];
|
||||
|
||||
return get_property(conf, "vga", property);
|
||||
}
|
||||
|
||||
int read_config_modem(int8_t *conf, int *bitrate, int *parity, int *datasize, int *stopbits)
|
||||
int read_config_vga(emile_l2_header_t* info)
|
||||
{
|
||||
int8_t *configuration;
|
||||
char property[64];
|
||||
int ret;
|
||||
|
||||
ret = get_property(conf, "modem", property);
|
||||
configuration = open_config(info);
|
||||
ret = get_property(configuration, "vga", property);
|
||||
close_config(configuration);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int read_config_modem(emile_l2_header_t* info, int *bitrate, int *parity, int *datasize, int *stopbits)
|
||||
{
|
||||
int8_t *configuration;
|
||||
char property[64];
|
||||
int ret;
|
||||
|
||||
configuration = open_config(info);
|
||||
ret = get_property(configuration, "modem", property);
|
||||
if (ret == -1)
|
||||
{
|
||||
close_config(configuration);
|
||||
return -1;
|
||||
}
|
||||
|
||||
decode_serial(property, bitrate, parity, datasize, stopbits);
|
||||
close_config(configuration);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_config_printer(int8_t *conf, int *bitrate, int *parity, int *datasize, int *stopbits)
|
||||
int read_config_printer(emile_l2_header_t* info, int *bitrate, int *parity, int *datasize, int *stopbits)
|
||||
{
|
||||
int8_t *configuration;
|
||||
char property[64];
|
||||
int ret;
|
||||
|
||||
ret = get_property(conf, "printer", property);
|
||||
configuration = open_config(info);
|
||||
ret = get_property(configuration, "printer", property);
|
||||
if (ret == -1)
|
||||
{
|
||||
close_config(configuration);
|
||||
return -1;
|
||||
}
|
||||
|
||||
decode_serial(property, bitrate, parity, datasize, stopbits);
|
||||
close_config(configuration);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "head.h"
|
||||
|
||||
extern int read_config(emile_l2_header_t* info, char **kernel_path, char **command_line, char **ramdisk_path);
|
||||
extern int read_config_vga(int8_t *conf);
|
||||
extern int read_config_modem(int8_t *conf, int *bitrate, int *parity, int *datasize, int *stopbits);
|
||||
extern int read_config_printer(int8_t *conf, int *bitrate, int *parity, int *datasize, int *stopbits);
|
||||
extern int read_config_vga(emile_l2_header_t* info);
|
||||
extern int read_config_modem(emile_l2_header_t* info, int *bitrate, int *parity, int *datasize, int *stopbits);
|
||||
extern int read_config_printer(emile_l2_header_t* info, int *bitrate, int *parity, int *datasize, int *stopbits);
|
||||
|
@ -19,7 +19,7 @@ static int vga_enabled = 0;
|
||||
void
|
||||
console_init(emile_l2_header_t* info)
|
||||
{
|
||||
if (read_config_vga(info->configuration) == 0)
|
||||
if (read_config_vga(info) == 0)
|
||||
{
|
||||
if (vga_init())
|
||||
vga_enabled = 0;
|
||||
|
@ -237,7 +237,7 @@ void serial_init(emile_l2_header_t* info)
|
||||
int res;
|
||||
int bitrate, parity, datasize, stopbits;
|
||||
|
||||
res = read_config_modem(info->configuration,
|
||||
res = read_config_modem(info,
|
||||
&bitrate, &parity, &datasize, &stopbits);
|
||||
if (res != -1)
|
||||
{
|
||||
@ -275,7 +275,7 @@ void serial_init(emile_l2_header_t* info)
|
||||
#endif /* USE_CLI */
|
||||
}
|
||||
|
||||
res = read_config_printer(info->configuration,
|
||||
res = read_config_printer(info,
|
||||
&bitrate, &parity, &datasize, &stopbits);
|
||||
if (res != -1) {
|
||||
res = OpenDriver(c2pstring(".BOut"), &out_refnum1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user