Compare commits

..

5 Commits

Author SHA1 Message Date
sago35 d7e8de7b8c device: change the import path 2021-07-08 20:56:53 +09:00
Ayke van Laethem 0565b7c0e0 cortexm: fix stack overflow because of unaligned stacks
On ARM, the stack has to be aligned to 8 bytes on function calls, but
not necessarily within a function. Leaf functions can take advantage of
this by not keeping the stack aligned so they can avoid pushing one
register. However, because regular functions might expect an aligned
stack, the interrupt controller will forcibly re-align the stack when an
interrupt happens in such a leaf function (controlled by the STKALIGN
flag, defaults to on). This means that stack size calculation (as used
in TinyGo) needs to make sure this extra space for stack re-alignment is
available.

This commit fixes this by aligning the stack size that will be used for
new goroutines.

Additionally, it increases the stack canary size from 4 to 8 bytes, to
keep the stack aligned. This is not strictly necessary but is required
by the AAPCS so let's do it anyway just to be sure.
2021-07-07 09:25:47 +02:00
soypat 444dded92c move xtoi2 to parse.go 2021-07-02 18:49:14 +02:00
Patricio Whittingslow 42785e08e8 add MAC address implementation to net 2021-07-02 18:49:14 +02:00
sago35 2d633e3a28 version: update TinyGo version to 0.20.0-dev 2021-07-02 18:47:30 +02:00
172 changed files with 308 additions and 204 deletions
+18 -6
View File
@@ -953,15 +953,19 @@ func modifyStackSizes(executable string, stackSizeLoads []string, stackSizes map
if fn.stackSizeType == stacksize.Bounded {
stackSize := uint32(fn.stackSize)
// Adding 4 for the stack canary. Even though the size may be
// automatically determined, stack overflow checking is still
// important as the stack size cannot be determined for all
// goroutines.
stackSize += 4
// Add stack size used by interrupts.
switch fileHeader.Machine {
case elf.EM_ARM:
if stackSize%8 != 0 {
// If the stack isn't a multiple of 8, it means the leaf
// function with the biggest stack depth doesn't have an aligned
// stack. If the STKALIGN flag is set (which it is by default)
// the interrupt controller will forcibly align the stack before
// storing in-use registers. This will thus overwrite one word
// past the end of the stack (off-by-one).
stackSize += 4
}
// On Cortex-M (assumed here), this stack size is 8 words or 32
// bytes. This is only to store the registers that the interrupt
// may modify, the interrupt will switch to the interrupt stack
@@ -969,6 +973,14 @@ func modifyStackSizes(executable string, stackSizeLoads []string, stackSizes map
// Some background:
// https://interrupt.memfault.com/blog/cortex-m-rtos-context-switching
stackSize += 32
// Adding 4 for the stack canary, and another 4 to keep the
// stack aligned. Even though the size may be automatically
// determined, stack overflow checking is still important as the
// stack size cannot be determined for all goroutines.
stackSize += 8
default:
return fmt.Errorf("unknown architecture: %s", fileHeader.Machine.String())
}
// Finally write the stack size to the binary.
+5 -5
View File
@@ -1298,15 +1298,15 @@ func (b *builder) createFunctionCall(instr *ssa.CallCommon) (llvm.Value, error)
return b.createMemoryCopyCall(fn, instr.Args)
case name == "runtime.memzero":
return b.createMemoryZeroCall(instr.Args)
case name == "device.Asm" || name == "device/arm.Asm" || name == "device/arm64.Asm" || name == "device/avr.Asm" || name == "device/riscv.Asm":
case name == "github.com/sago35/device.Asm" || name == "github.com/sago35/device/arm.Asm" || name == "github.com/sago35/device/arm64.Asm" || name == "github.com/sago35/device/avr.Asm" || name == "github.com/sago35/device/riscv.Asm":
return b.createInlineAsm(instr.Args)
case name == "device.AsmFull" || name == "device/arm.AsmFull" || name == "device/arm64.AsmFull" || name == "device/avr.AsmFull" || name == "device/riscv.AsmFull":
case name == "github.com/sago35/device.AsmFull" || name == "github.com/sago35/device/arm.AsmFull" || name == "github.com/sago35/device/arm64.AsmFull" || name == "github.com/sago35/device/avr.AsmFull" || name == "github.com/sago35/device/riscv.AsmFull":
return b.createInlineAsmFull(instr)
case strings.HasPrefix(name, "device/arm.SVCall"):
case strings.HasPrefix(name, "github.com/sago35/device/arm.SVCall"):
return b.emitSVCall(instr.Args)
case strings.HasPrefix(name, "device/arm64.SVCall"):
case strings.HasPrefix(name, "github.com/sago35/device/arm64.SVCall"):
return b.emitSV64Call(instr.Args)
case strings.HasPrefix(name, "(device/riscv.CSR)."):
case strings.HasPrefix(name, "(github.com/sago35/device/riscv.CSR)."):
return b.emitCSROperation(instr)
case strings.HasPrefix(name, "syscall.Syscall"):
return b.createSyscall(instr)
+1
View File
@@ -9,6 +9,7 @@ require (
github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf
github.com/marcinbor85/gohex v0.0.0-20200531091804-343a4b548892
github.com/mattn/go-colorable v0.1.8
github.com/sago35/device v0.0.0-20210708114705-5c2c56419249
go.bug.st/serial v1.1.2
golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2
+7 -6
View File
@@ -8,6 +8,7 @@ github.com/chromedp/sysutil v1.0.0 h1:+ZxhTpfpZlmchB58ih/LBHX52ky7w2VhQVKQMucy3I
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/creack/goselect v0.1.1 h1:tiSSgKE1eJtxs1h/VgGQWuXUP0YS4CDIFMp6vaI1ls0=
github.com/creack/goselect v0.1.1/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU=
github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM=
@@ -27,11 +28,13 @@ github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sago35/device v0.0.0-20210708114705-5c2c56419249 h1:GU6dEpii0PsE4TF8RuOcEWzbbCZQPtcqdVdZsQXy/Uw=
github.com/sago35/device v0.0.0-20210708114705-5c2c56419249/go.mod h1:N8KfLtl2y31BvW1T9LmO7P+QkfoJk7SurI+0N0lCuOo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
go.bug.st/serial v1.0.0 h1:ogEPzrllCsnG00EqKRjeYvPRsO7NJW6DqykzkdD6E/k=
go.bug.st/serial v1.0.0/go.mod h1:rpXPISGjuNjPTRTcMlxi9lN6LoIPxd1ixVjBd8aSk/Q=
go.bug.st/serial v1.1.2 h1:6xDpbta8KJ+VLRTeM8ghhxXRMLE/Lr8h9iDKwydarAY=
go.bug.st/serial v1.1.2/go.mod h1:VmYBeyJWp5BnJ0tw2NUJHZdJTGl2ecBGABHlzRK1knY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -43,8 +46,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -55,9 +56,9 @@ golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2 h1:0sfSpGSa544Fwnbot3Oxq/U
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
tinygo.org/x/go-llvm v0.0.0-20210308112806-9ef958b6bed4 h1:CMUHxVTb+UuUePuMf8vkWjZ3gTp9BBK91KrgOCwoNHs=
tinygo.org/x/go-llvm v0.0.0-20210308112806-9ef958b6bed4/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE=
tinygo.org/x/go-llvm v0.0.0-20210325115028-e7b85195e81c h1:vn9IPshzYmzZis10UEVrsIBRv9FpykADw6M3/tHHROg=
tinygo.org/x/go-llvm v0.0.0-20210325115028-e7b85195e81c/go.mod h1:fv1F0BSNpxMfCL0zF3M4OPFbgYHnhtB6ST0HvUtu/LE=
+1 -1
View File
@@ -12,7 +12,7 @@ import (
// Version of TinyGo.
// Update this value before release of new version of software.
const Version = "0.19.0"
const Version = "0.20.0-dev"
// GetGorootVersion returns the major and minor version for a given GOROOT path.
// If the goroot cannot be determined, (0, 0) is returned.
+1 -1
View File
@@ -7,7 +7,7 @@
package nxp
import (
"device/arm"
"github.com/sago35/device/arm"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package main
import (
"device/sam"
"github.com/sago35/device/sam"
"fmt"
"machine"
"time"
+1 -1
View File
@@ -1,7 +1,7 @@
package main
import (
"device/arm"
"github.com/sago35/device/arm"
"machine"
)
+1 -1
View File
@@ -9,7 +9,7 @@ package task
// space for interrupts.
import (
"device/arm"
"github.com/sago35/device/arm"
"unsafe"
)
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -2,7 +2,7 @@
package machine
import "device/sifive"
import "github.com/sago35/device/sifive"
// SPI on the HiFive1.
var (
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -2,7 +2,7 @@
package machine
import "device/kendryte"
import "github.com/sago35/device/kendryte"
// SPI on the MAix Bit.
var (
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -2,7 +2,7 @@
package machine
import "device/sam"
import "github.com/sago35/device/sam"
// used to reset into bootloader
const RESET_MAGIC_VALUE = 0xf01669ef
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nxp"
"github.com/sago35/device/nxp"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/interrupt"
"runtime/volatile"
"unsafe"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/interrupt"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/interrupt"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/volatile"
)
+2 -2
View File
@@ -8,8 +8,8 @@
package machine
import (
"device/arm"
"device/sam"
"github.com/sago35/device/arm"
"github.com/sago35/device/sam"
"errors"
"runtime/interrupt"
"runtime/volatile"
+1 -1
View File
@@ -8,7 +8,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
)
// Return the register and mask to enable a given GPIO pin. This can be used to
+1 -1
View File
@@ -8,7 +8,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
)
// Return the register and mask to enable a given GPIO pin. This can be used to
+2 -2
View File
@@ -8,8 +8,8 @@
package machine
import (
"device/arm"
"device/sam"
"github.com/sago35/device/arm"
"github.com/sago35/device/sam"
"errors"
"runtime/interrupt"
"runtime/volatile"
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00030000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00030000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00040000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00030000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00040000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00030000
+1 -1
View File
@@ -7,7 +7,7 @@
//
package machine
import "device/sam"
import "github.com/sago35/device/sam"
const HSRAM_SIZE = 0x00040000
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sam"
"github.com/sago35/device/sam"
"errors"
"runtime/interrupt"
"unsafe"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/avr"
"github.com/sago35/device/avr"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/esp"
"github.com/sago35/device/esp"
"errors"
"runtime/volatile"
"unsafe"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/esp"
"github.com/sago35/device/esp"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/sifive"
"github.com/sago35/device/sifive"
"runtime/interrupt"
"unsafe"
)
+2 -2
View File
@@ -3,8 +3,8 @@
package machine
import (
"device/kendryte"
"device/riscv"
"github.com/sago35/device/kendryte"
"github.com/sago35/device/riscv"
"errors"
"runtime/interrupt"
"unsafe"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nxp"
"github.com/sago35/device/nxp"
"math/bits"
"runtime/interrupt"
"runtime/volatile"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nxp"
"github.com/sago35/device/nxp"
"runtime/interrupt"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
"errors"
"runtime/interrupt"
"unsafe"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
)
func CPUFrequency() uint32 {
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
)
// Hardware pins
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
)
// Hardware pins
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
)
// Hardware pins
+2 -2
View File
@@ -3,8 +3,8 @@
package machine
import (
"device/arm"
"device/nrf"
"github.com/sago35/device/arm"
"github.com/sago35/device/nrf"
"runtime/interrupt"
"runtime/volatile"
"unsafe"
@@ -3,8 +3,8 @@
package machine
import (
"device/arm"
"device/nrf"
"github.com/sago35/device/arm"
"github.com/sago35/device/nrf"
)
const DFU_MAGIC_SERIAL_ONLY_RESET = 0xb0
@@ -3,8 +3,8 @@
package machine
import (
"device/arm"
"device/nrf"
"github.com/sago35/device/arm"
"github.com/sago35/device/nrf"
)
const (
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/nrf"
"github.com/sago35/device/nrf"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -32,7 +32,7 @@
package machine
import (
"device/nxp"
"github.com/sago35/device/nxp"
"runtime/volatile"
"unsafe"
)
+2 -2
View File
@@ -32,8 +32,8 @@
package machine
import (
"device/arm"
"device/nxp"
"github.com/sago35/device/arm"
"github.com/sago35/device/nxp"
"errors"
"runtime/interrupt"
"runtime/volatile"
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
)
func InitADC() {
+2 -2
View File
@@ -3,8 +3,8 @@
package machine
import (
"device/arm"
"device/rp"
"github.com/sago35/device/arm"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/interrupt"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/rp"
"github.com/sago35/device/rp"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/volatile"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
)
// This variant of the GPIO input interrupt logic is for
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
)
// This variant of the GPIO input interrupt logic is for
+1 -1
View File
@@ -6,7 +6,7 @@ package machine
// of MCUs.
import (
"device/stm32"
"github.com/sago35/device/stm32"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
)
// GPIO for the stm32 families except the stm32f1xx which uses a simpler but
+1 -1
View File
@@ -5,7 +5,7 @@ package machine
// Peripheral abstraction layer for SPI on the stm32 family
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/volatile"
"unsafe"
)
+1 -1
View File
@@ -3,7 +3,7 @@
package machine
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
"runtime/volatile"
)
+1 -1
View File
@@ -5,7 +5,7 @@ package machine
// Peripheral abstraction layer for UARTs on the stm32 family.
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
"runtime/volatile"
"unsafe"
+1 -1
View File
@@ -5,7 +5,7 @@ package machine
// Peripheral abstraction layer for the stm32.
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
"runtime/volatile"
"unsafe"
+1 -1
View File
@@ -5,7 +5,7 @@ package machine
// Peripheral abstraction layer for the stm32f4
import (
"device/stm32"
"github.com/sago35/device/stm32"
"runtime/interrupt"
"runtime/volatile"
"unsafe"

Some files were not shown because too many files have changed in this diff Show More