Skip to content

Commit

Permalink
Fix typos (#183)
Browse files Browse the repository at this point in the history
Co-authored-by: Cristian Maglie <[email protected]>
  • Loading branch information
deining and cmaglie authored Jun 24, 2024
1 parent c18d387 commit 0b78485
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion enumerator/usb_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const (
spdrpUpperFilters = 0x00000011 // UpperFilters = R/W
spdrpLowerFilters = 0x00000012 // LowerFilters = R/W
spdrpBusTypeGUID = 0x00000013 // BusTypeGUID = R
spdrpLegactBusType = 0x00000014 // LegacyBusType = R
spdrpLegacyBusType = 0x00000014 // LegacyBusType = R
spdrpBusNumber = 0x00000015 // BusNumber = R
spdrpEnumeratorName = 0x00000016 // Enumerator Name = R
spdrpSecurity = 0x00000017 // Security = R/W, binary form
Expand Down
2 changes: 1 addition & 1 deletion serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const (
PortNotFound
// InvalidSerialPort the requested port is not a serial port
InvalidSerialPort
// PermissionDenied the user doesn't have enough priviledges
// PermissionDenied the user doesn't have enough privileges
PermissionDenied
// InvalidSpeed the requested speed is not valid or not supported
InvalidSpeed
Expand Down
10 changes: 5 additions & 5 deletions serial_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const (
dcbInX = 0x00000200
dcbErrorChar = 0x00000400
dcbNull = 0x00000800
dcbRTSControlDisbaleMask = ^uint32(0x00003000)
dcbRTSControlDisableMask = ^uint32(0x00003000)
dcbRTSControlEnable = 0x00001000
dcbRTSControlHandshake = 0x00002000
dcbRTSControlToggle = 0x00003000
Expand Down Expand Up @@ -282,8 +282,8 @@ func (port *windowsPort) SetDTR(dtr bool) error {
// observed behaviour was that DTR is set from false -> true
// when setting RTS from true -> false
// 1) Connect -> RTS = true (low) DTR = true (low) OKAY
// 2) SetDTR(false) -> RTS = true (low) DTR = false (heigh) OKAY
// 3) SetRTS(false) -> RTS = false (heigh) DTR = true (low) ERROR: DTR toggled
// 2) SetDTR(false) -> RTS = true (low) DTR = false (high) OKAY
// 3) SetRTS(false) -> RTS = false (high) DTR = true (low) ERROR: DTR toggled
//
// In addition this way the CommState Flags are not updated
/*
Expand Down Expand Up @@ -343,7 +343,7 @@ func (port *windowsPort) SetRTS(rts bool) error {
if err := getCommState(port.handle, params); err != nil {
return &PortError{causedBy: err}
}
params.Flags &= dcbRTSControlDisbaleMask
params.Flags &= dcbRTSControlDisableMask
if rts {
params.Flags |= dcbRTSControlEnable
}
Expand Down Expand Up @@ -443,7 +443,7 @@ func nativeOpen(portName string, mode *Mode) (*windowsPort, error) {
}
port.setModeParams(mode, params)
params.Flags &= dcbDTRControlDisableMask
params.Flags &= dcbRTSControlDisbaleMask
params.Flags &= dcbRTSControlDisableMask
if mode.InitialStatusBits == nil {
params.Flags |= dcbDTRControlEnable
params.Flags |= dcbRTSControlEnable
Expand Down
4 changes: 2 additions & 2 deletions unixutils/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func (p *Pipe) ReadFD() int {
return p.rd
}

// WriteFD returns the flie handle for the write side of the pipe.
// WriteFD returns the file handle for the write side of the pipe.
func (p *Pipe) WriteFD() int {
if !p.opened {
return -1
}
return p.wr
}

// Write to the pipe the content of data. Returns the numbre of bytes written.
// Write to the pipe the content of data. Returns the number of bytes written.
func (p *Pipe) Write(data []byte) (int, error) {
if !p.opened {
return 0, fmt.Errorf("Pipe not opened")
Expand Down

0 comments on commit 0b78485

Please sign in to comment.