summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/device-functions.c b/device-functions.c
index 4753b28..8812cfa 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -4622,17 +4622,8 @@ void Main_update_shift_registers()
}
-int IO_Setup_RS232(int baud, char stopbits, char hardhand, char echo, gboolean update_flash)
+int IO_Setup_RS232(int baud, char hardhand, gboolean update_flash)
{
- // debugging
- printf ("baud: %d, stop bits %d, handshaking %d, echo %d\n\r",
- baud,
- stopbits,
- hardhand, // 0 = none, 1 = hard
- echo);
-
- // FIXME implement serial port changes here
-
FILE* configfile = fopen("/tmp/instgettyopts", "w");
if(configfile) {
fprintf(configfile, "OPTS=-L %s\n", hardhand ? "-h" : "");
@@ -4641,22 +4632,16 @@ int IO_Setup_RS232(int baud, char stopbits, char hardhand, char echo, gboolean u
system("systemctl --no-block restart inst-getty@ttyO5.service");
}
- if (1) { // FIXME if changes are successful
- globals.Flash.baud = baud;
- globals.Flash.stopbits = stopbits;
- globals.Flash.hardhand = hardhand;
- globals.Flash.echo = echo;
+ globals.Flash.baud = baud;
+ globals.Flash.hardhand = hardhand;
- if (update_flash) {
- int size = sizeof(globals.Flash.baud) + sizeof(globals.Flash.parity) + sizeof(globals.Flash.stopbits) +
- sizeof(globals.Flash.databits) + sizeof(globals.Flash.hardhand) + sizeof(globals.Flash.echo);
+ if (update_flash) {
+ int size = sizeof(globals.Flash.baud) + sizeof(globals.Flash.parity) + sizeof(globals.Flash.stopbits) +
+ sizeof(globals.Flash.databits) + sizeof(globals.Flash.hardhand) + sizeof(globals.Flash.echo);
- int eprom_loc = (char *) &(globals.Flash.baud) - (char *) &(globals.Flash.flash_start);
- writeUserBlock(&globals.Flash, eprom_loc, size);
- }
- return OK;
- } else {
- return HardwareError;
+ int eprom_loc = (char *) &(globals.Flash.baud) - (char *) &(globals.Flash.flash_start);
+ writeUserBlock(&globals.Flash, eprom_loc, size);
}
+ return OK;
}