summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--display-gtk.h2
-rw-r--r--gtk-gui.c2
-rw-r--r--linux.c5
-rw-r--r--macos.c5
-rw-r--r--windows.c5
5 files changed, 18 insertions, 1 deletions
diff --git a/display-gtk.h b/display-gtk.h
index 8ca5a450e..b20495731 100644
--- a/display-gtk.h
+++ b/display-gtk.h
@@ -32,6 +32,8 @@ extern void subsurface_set_conf(char *name, pref_type_t type, const void *value)
extern const void *subsurface_get_conf(char *name, pref_type_t type);
extern void subsurface_close_conf(void);
+extern const char *subsurface_USB_name(void);
+
extern visible_cols_t visible_cols;
extern const char *divelist_font;
diff --git a/gtk-gui.c b/gtk-gui.c
index eae080808..c6b79b690 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -913,7 +913,7 @@ static GtkEntry *dive_computer_device(GtkWidget *vbox)
entry = gtk_entry_new();
gtk_container_add(GTK_CONTAINER(frame), entry);
- gtk_entry_set_text(GTK_ENTRY(entry), "/dev/ttyUSB0");
+ gtk_entry_set_text(GTK_ENTRY(entry), subsurface_USB_name());
return GTK_ENTRY(entry);
}
diff --git a/linux.c b/linux.c
index 2edcf85a1..e26b3acbd 100644
--- a/linux.c
+++ b/linux.c
@@ -46,3 +46,8 @@ void subsurface_close_conf(void)
{
/* this is a no-op */
}
+
+const char *subsurface_USB_name()
+{
+ return("/dev/ttyUSB0");
+}
diff --git a/macos.c b/macos.c
index b48f20d87..0b64e19a0 100644
--- a/macos.c
+++ b/macos.c
@@ -89,3 +89,8 @@ void subsurface_close_conf(void)
CFRelease(xmlData);
CFRelease(propertyList);
}
+
+const char *subsurface_USB_name()
+{
+ return("/dev/tty.SLAB_USBtoUART");
+}
diff --git a/windows.c b/windows.c
index e4c811984..3e40c38ef 100644
--- a/windows.c
+++ b/windows.c
@@ -78,3 +78,8 @@ void subsurface_close_conf(void)
printf("RegFlushKey failed \n");
RegCloseKey(hkey);
}
+
+const char *subsurface_USB_name()
+{
+ return("COM3");
+}