-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed cross compilation on MIPS architecture (#10)
* Fixed termios portability issue. * Cleaned up for cross compilation.
- Loading branch information
Showing
5 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// +build freebsd openbsd netbsd | ||
|
||
package serial | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
func cfSetIspeed(termios *syscall.Termios, speed uint32) { | ||
termios.Ispeed = speed | ||
} | ||
|
||
func cfSetOspeed(termios *syscall.Termios, speed uint32) { | ||
termios.Ospeed = speed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package serial | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
func cfSetIspeed(termios *syscall.Termios, speed uint64) { | ||
termios.Ispeed = speed | ||
} | ||
|
||
func cfSetOspeed(termios *syscall.Termios, speed uint64) { | ||
termios.Ospeed = speed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// +build !mips,!mipsle,!mips64,!mips64le | ||
|
||
package serial | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
func cfSetIspeed(termios *syscall.Termios, speed uint32) { | ||
termios.Ispeed = speed | ||
} | ||
|
||
func cfSetOspeed(termios *syscall.Termios, speed uint32) { | ||
termios.Ospeed = speed | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// +build linux | ||
// +build mips mipsle mips64 mips64le | ||
|
||
package serial | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
func cfSetIspeed(termios *syscall.Termios, speed uint32) { | ||
// MIPS has no Ispeed field in termios. | ||
} | ||
|
||
func cfSetOspeed(termios *syscall.Termios, speed uint32) { | ||
// MIPS has no Ospeed field in termios. | ||
} |