From 0b7848559acc54148cec234c28eb7f88612673d6 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 24 Jun 2024 17:33:18 +0200 Subject: [PATCH] Fix typos (#183) Co-authored-by: Cristian Maglie --- enumerator/usb_windows.go | 2 +- serial.go | 2 +- serial_windows.go | 10 +++++----- unixutils/pipe.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/enumerator/usb_windows.go b/enumerator/usb_windows.go index c8018f9..2d3793b 100644 --- a/enumerator/usb_windows.go +++ b/enumerator/usb_windows.go @@ -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 diff --git a/serial.go b/serial.go index 8e3ce89..a2f7333 100644 --- a/serial.go +++ b/serial.go @@ -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 diff --git a/serial_windows.go b/serial_windows.go index e350f86..b2c9009 100644 --- a/serial_windows.go +++ b/serial_windows.go @@ -152,7 +152,7 @@ const ( dcbInX = 0x00000200 dcbErrorChar = 0x00000400 dcbNull = 0x00000800 - dcbRTSControlDisbaleMask = ^uint32(0x00003000) + dcbRTSControlDisableMask = ^uint32(0x00003000) dcbRTSControlEnable = 0x00001000 dcbRTSControlHandshake = 0x00002000 dcbRTSControlToggle = 0x00003000 @@ -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 /* @@ -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 } @@ -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 diff --git a/unixutils/pipe.go b/unixutils/pipe.go index c11e0d1..f54c916 100644 --- a/unixutils/pipe.go +++ b/unixutils/pipe.go @@ -40,7 +40,7 @@ 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 @@ -48,7 +48,7 @@ func (p *Pipe) WriteFD() int { 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")