mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
GNUmakefile: add spellfix target, use it. (#4387)
TODO: Remove the go.mod/go.sum in internal/tools once doing so doesn't break CI (e.g. once we drop support for go 1.19) * builder/cc1as.h: fix typo found by 'make spell' * GNUmakefile: remove exception for inbetween, fix instance now found by 'make spell' * GNUmakefile: remove exception for programmmer, fix instance now found by 'make spell' * go.mod: use updated misspell. GNUmakefile: add spellfix target, use it. * ignore directories properly when invoking spellchecker. * make spell: give internal/tools its own go.mod, as misspell requires newer go * make lint: depend on tools and run the installed revive (which was perhaps implied by the change that added revive to internal/tools, but not required in GNUmakefile until we gave internal/tools its own temporary go.mod) * .github: now that 'make spell' works well, run it from CI * GNUmakefile: make spell now aborts if it finds misspelt words, so what it finds doesn't get lost in CI logs * GNUmakefile: tools: avoid -C option on go generate to make test-llvm15-go119 circleci job happy, see https://cs.opensource.google/go/go/+/2af48cbb7d85e5fdc635e75b99f949010c607786 * internal/tools/go.mod: fix format of go version to leave out patchlevel, else go complains.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// This implementation of crypto/rand uses the arc4random_buf function
|
||||
// (available on both MacOS and WASI) to generate random numbers.
|
||||
//
|
||||
// Note: arc4random_buf (unlike what the name suggets) does not use the insecure
|
||||
// Note: arc4random_buf (unlike what the name suggests) does not use the insecure
|
||||
// RC4 cipher. Instead, it uses a high-quality cipher, varying by the libc
|
||||
// implementation.
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ type Dialer struct {
|
||||
//
|
||||
// The returned Conn, if any, will always be of type *Conn.
|
||||
func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
|
||||
return nil, errors.New("tls:DialContext not implmented")
|
||||
return nil, errors.New("tls:DialContext not implemented")
|
||||
}
|
||||
|
||||
// LoadX509KeyPair reads and parses a public/private key pair from a pair
|
||||
|
||||
@@ -180,7 +180,7 @@ func (pwm PWM) Configure(config PWMConfig) error {
|
||||
// Set the PWM mode to fast PWM (mode = 3).
|
||||
avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01)
|
||||
// monotonic timer is using the same time as PWM:0
|
||||
// we must adust internal settings of monotonic timer when PWM:0 settings changed
|
||||
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
|
||||
adjustMonotonicTimer()
|
||||
} else {
|
||||
avr.TCCR2B.Set(prescaler)
|
||||
@@ -718,7 +718,7 @@ func (pwm PWM) Set(channel uint8, value uint32) {
|
||||
}
|
||||
}
|
||||
// monotonic timer is using the same time as PWM:0
|
||||
// we must adust internal settings of monotonic timer when PWM:0 settings changed
|
||||
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
|
||||
adjustMonotonicTimer()
|
||||
case 1:
|
||||
mask := interrupt.Disable()
|
||||
|
||||
@@ -56,7 +56,7 @@ func (pwm PWM) Configure(config PWMConfig) error {
|
||||
// Set the PWM mode to fast PWM (mode = 3).
|
||||
avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01)
|
||||
// monotonic timer is using the same time as PWM:0
|
||||
// we must adust internal settings of monotonic timer when PWM:0 settings changed
|
||||
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
|
||||
adjustMonotonicTimer()
|
||||
} else {
|
||||
avr.TCCR2B.Set(prescaler)
|
||||
@@ -385,7 +385,7 @@ func (pwm PWM) Set(channel uint8, value uint32) {
|
||||
}
|
||||
}
|
||||
// monotonic timer is using the same time as PWM:0
|
||||
// we must adust internal settings of monotonic timer when PWM:0 settings changed
|
||||
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
|
||||
adjustMonotonicTimer()
|
||||
case 1:
|
||||
mask := interrupt.Disable()
|
||||
|
||||
@@ -480,7 +480,7 @@ func (uart *UART) enableTransmitter() {
|
||||
uart.Bus.SetCONF0_TXFIFO_RST(0)
|
||||
// TXINFO empty threshold is when txfifo_empty_int interrupt produced after the amount of data in Tx-FIFO is less than this register value.
|
||||
uart.Bus.SetCONF1_TXFIFO_EMPTY_THRHD(uart_empty_thresh_default)
|
||||
// we are not using interrut on TX since write we are waiting for FIFO to have space.
|
||||
// we are not using interrupt on TX since write we are waiting for FIFO to have space.
|
||||
// uart.Bus.INT_ENA.SetBits(esp.UART_INT_ENA_TXFIFO_EMPTY_INT_ENA)
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ func (p Pin) getGPIO() (norm *nxp.GPIO_Type, fast *nxp.GPIO_Type) {
|
||||
}
|
||||
}
|
||||
|
||||
// getPad returns both the pad and mux configration registers for a given Pin.
|
||||
// getPad returns both the pad and mux configuration registers for a given Pin.
|
||||
func (p Pin) getPad() (pad *volatile.Register32, mux *volatile.Register32) {
|
||||
switch p.getPort() {
|
||||
case portA:
|
||||
|
||||
@@ -24,7 +24,7 @@ var (
|
||||
// here: https://github.com/vmilea/pico_i2c_slave
|
||||
|
||||
// Features: Taken from datasheet.
|
||||
// Default controller mode, with target mode available (not simulataneously).
|
||||
// Default controller mode, with target mode available (not simultaneously).
|
||||
// Default target address of RP2040: 0x055
|
||||
// Supports 10-bit addressing in controller mode
|
||||
// 16-element transmit buffer
|
||||
|
||||
@@ -399,7 +399,7 @@ func (i2c *I2C) getFreqRange(config I2CConfig) uint32 {
|
||||
// pclk1 clock speed is main frequency divided by PCLK1 prescaler (div 2)
|
||||
pclk1 := CPUFrequency() / 2
|
||||
|
||||
// set freqency range to PCLK1 clock speed in MHz
|
||||
// set frequency range to PCLK1 clock speed in MHz
|
||||
// aka setting the value 36 means to use 36 MHz clock
|
||||
return pclk1 / 1000000
|
||||
}
|
||||
|
||||
@@ -256,10 +256,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 {
|
||||
}
|
||||
|
||||
// set frequency dependent on PCLK prescaler. Since these are rather weird
|
||||
// speeds due to the CPU freqency, pick a range up to that frquency for
|
||||
// speeds due to the CPU frequency, pick a range up to that frequency for
|
||||
// clients to use more human-understandable numbers, e.g. nearest 100KHz
|
||||
|
||||
// These are based on APB2 clock frquency (84MHz on the discovery board)
|
||||
// These are based on APB2 clock frequency (84MHz on the discovery board)
|
||||
// TODO: also include the MCU/APB clock setting in the equation
|
||||
switch {
|
||||
case localFrequency < 328125:
|
||||
|
||||
@@ -327,10 +327,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 {
|
||||
localFrequency := config.Frequency
|
||||
|
||||
// set frequency dependent on PCLK prescaler. Since these are rather weird
|
||||
// speeds due to the CPU freqency, pick a range up to that frquency for
|
||||
// speeds due to the CPU frequency, pick a range up to that frequency for
|
||||
// clients to use more human-understandable numbers, e.g. nearest 100KHz
|
||||
|
||||
// These are based on 80MHz peripheral clock frquency
|
||||
// These are based on 80MHz peripheral clock frequency
|
||||
switch {
|
||||
case localFrequency < 312500:
|
||||
conf = stm32.SPI_CR1_BR_Div256
|
||||
|
||||
@@ -88,6 +88,7 @@ func (p *Process) Release() error {
|
||||
return p.release()
|
||||
}
|
||||
|
||||
// FindProcess looks for a running process by its pid.
|
||||
// Keep compatibility with golang and always succeed and return new proc with pid on Linux.
|
||||
func FindProcess(pid int) (*Process, error) {
|
||||
return findProcess(pid)
|
||||
|
||||
@@ -56,7 +56,7 @@ func TestStatBadDir(t *testing.T) {
|
||||
badDir := filepath.Join(dir, "not-exist/really-not-exist")
|
||||
_, err := Stat(badDir)
|
||||
if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir {
|
||||
t.Errorf("Mkdir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir)
|
||||
t.Errorf("Mkdir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ func TestMkdirTempBadDir(t *testing.T) {
|
||||
badDir := filepath.Join(dir, "not-exist")
|
||||
_, err = MkdirTemp(badDir, "foo")
|
||||
if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir {
|
||||
t.Errorf("TempDir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir)
|
||||
t.Errorf("TempDir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ const (
|
||||
|
||||
// The base type struct. All type structs start with this.
|
||||
type rawType struct {
|
||||
meta uint8 // metadata byte, contains kind and flags (see contants above)
|
||||
meta uint8 // metadata byte, contains kind and flags (see constants above)
|
||||
}
|
||||
|
||||
// All types that have an element type: named, chan, slice, array, map (but not
|
||||
|
||||
@@ -164,7 +164,7 @@ func TestTinyMap(t *testing.T) {
|
||||
// make sure we can get it out
|
||||
v2 := refut.MapIndex(ValueOf(unmarshalerText{"x", "y"}))
|
||||
if !v2.IsValid() || !v2.Bool() {
|
||||
t.Errorf("Failed to look up map struct key with refection")
|
||||
t.Errorf("Failed to look up map struct key with reflection")
|
||||
}
|
||||
|
||||
// put in a key with reflection
|
||||
|
||||
@@ -26,7 +26,7 @@ type stackChainObject struct {
|
||||
//
|
||||
// Therefore, we only need to scan the system stack.
|
||||
// It is relatively easy to scan the system stack while we're on it: we can
|
||||
// simply read __stack_pointer and __global_base and scan the area inbetween.
|
||||
// simply read __stack_pointer and __global_base and scan the area in between.
|
||||
// Unfortunately, it's hard to get the system stack pointer while we're on a
|
||||
// goroutine stack. But when we're on a goroutine stack, the system stack is in
|
||||
// the scheduler which means there shouldn't be anything on the system stack
|
||||
|
||||
@@ -27,7 +27,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {
|
||||
// SREG is at I/O address 0x3f.
|
||||
device.AsmFull("out 0x3f, {state}", map[string]interface{}{
|
||||
|
||||
@@ -46,7 +46,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {
|
||||
arm.EnableInterrupts(uintptr(state))
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {
|
||||
// Restore interrupts to the previous state.
|
||||
gba.INTERRUPT.PAUSE.Set(uint16(state))
|
||||
|
||||
@@ -21,7 +21,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {}
|
||||
|
||||
// In returns whether the system is currently in an interrupt.
|
||||
|
||||
@@ -23,7 +23,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {
|
||||
riscv.EnableInterrupts(uintptr(state))
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func Disable() (state State) {
|
||||
// Restore restores interrupts to what they were before. Give the previous state
|
||||
// returned by Disable as a parameter. If interrupts were disabled before
|
||||
// calling Disable, this will not re-enable interrupts, allowing for nested
|
||||
// cricital sections.
|
||||
// critical sections.
|
||||
func Restore(state State) {
|
||||
device.AsmFull("wsr {state}, PS", map[string]interface{}{
|
||||
"state": state,
|
||||
|
||||
@@ -120,7 +120,7 @@ func TestRWMutexUncontended(t *testing.T) {
|
||||
mu.Lock()
|
||||
mu.Unlock()
|
||||
|
||||
// Acuire several read locks.
|
||||
// Acquire several read locks.
|
||||
const n = 5
|
||||
for i := 0; i < n; i++ {
|
||||
mu.RLock()
|
||||
|
||||
Reference in New Issue
Block a user