Add initial FreeBSD support

This commit is contained in:
Dmitri Goutnik
2019-12-14 07:36:47 -05:00
committed by Ron Evans
parent 3b2a4b64c5
commit 71a380ce8c
8 changed files with 25 additions and 5 deletions
+4 -2
View File
@@ -452,7 +452,7 @@ func flashUF2UsingMSD(volume, tmppath string) error {
// find standard UF2 info path
var infoPath string
switch runtime.GOOS {
case "linux":
case "linux", "freebsd":
infoPath = "/media/*/" + volume + "/INFO_UF2.TXT"
case "darwin":
infoPath = "/Volumes/" + volume + "/INFO_UF2.TXT"
@@ -479,7 +479,7 @@ func flashHexUsingMSD(volume, tmppath string) error {
// find expected volume path
var destPath string
switch runtime.GOOS {
case "linux":
case "linux", "freebsd":
destPath = "/media/*/" + volume
case "darwin":
destPath = "/Volumes/" + volume
@@ -558,6 +558,8 @@ func getDefaultPort() (port string, err error) {
portPath = "/dev/cu.usb*"
case "linux":
portPath = "/dev/ttyACM*"
case "freebsd":
portPath = "/dev/cuaU*"
case "windows":
cmd := exec.Command("wmic",
"PATH", "Win32_SerialPort", "WHERE", "Caption LIKE 'USB Serial%'", "GET", "DeviceID")