go fmt
Этот коммит содержится в:
родитель
574c7ec047
коммит
62c4c5e90b
19 изменённых файлов: 28 добавлений и 45 удалений
|
@ -1,9 +1,7 @@
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go/types"
|
"go/types"
|
||||||
|
|
||||||
"golang.org/x/tools/go/ssa"
|
"golang.org/x/tools/go/ssa"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ type __reg uint32
|
||||||
type RegValue = __reg
|
type RegValue = __reg
|
||||||
|
|
||||||
type __asm string
|
type __asm string
|
||||||
|
|
||||||
func Asm(s __asm)
|
func Asm(s __asm)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
type Thing struct {
|
type Thing struct {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
type GPIOConfig struct {
|
type GPIOConfig struct {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build avr
|
// +build avr
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build !avr,!nrf
|
// +build !avr,!nrf
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build nrf
|
// +build nrf
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build !linux
|
// +build !linux
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
const Compiler = "tgo"
|
const Compiler = "tgo"
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build avr
|
// +build avr
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build nrf
|
// +build nrf
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
@ -29,7 +28,8 @@ func initUART() {
|
||||||
func initLFCLK() {
|
func initLFCLK() {
|
||||||
nrf.CLOCK.LFCLKSRC = nrf.CLOCK_LFCLKSTAT_SRC_Xtal
|
nrf.CLOCK.LFCLKSRC = nrf.CLOCK_LFCLKSTAT_SRC_Xtal
|
||||||
nrf.CLOCK.TASKS_LFCLKSTART = 1
|
nrf.CLOCK.TASKS_LFCLKSTART = 1
|
||||||
for nrf.CLOCK.EVENTS_LFCLKSTARTED == 0 {}
|
for nrf.CLOCK.EVENTS_LFCLKSTARTED == 0 {
|
||||||
|
}
|
||||||
nrf.CLOCK.EVENTS_LFCLKSTARTED = 0
|
nrf.CLOCK.EVENTS_LFCLKSTARTED = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,8 @@ func initRTC() {
|
||||||
|
|
||||||
func putchar(c byte) {
|
func putchar(c byte) {
|
||||||
nrf.UART0.TXD = nrf.RegValue(c)
|
nrf.UART0.TXD = nrf.RegValue(c)
|
||||||
for nrf.UART0.EVENTS_TXDRDY == 0 {}
|
for nrf.UART0.EVENTS_TXDRDY == 0 {
|
||||||
|
}
|
||||||
nrf.UART0.EVENTS_TXDRDY = 0
|
nrf.UART0.EVENTS_TXDRDY = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
// +build linux
|
// +build linux
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
// This file implements the Go scheduler using coroutines.
|
// This file implements the Go scheduler using coroutines.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
// TODO: use the time package for this.
|
// TODO: use the time package for this.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
// dummy
|
// dummy
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package unsafe
|
package unsafe
|
||||||
|
|
||||||
// dummy
|
// dummy
|
||||||
|
|
2
tgo.go
2
tgo.go
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1718,7 +1717,6 @@ func Compile(pkgName, runtimePath, outpath, target string, printIR, dumpSSA bool
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
outpath := flag.String("o", "", "output filename")
|
outpath := flag.String("o", "", "output filename")
|
||||||
printIR := flag.Bool("printir", false, "print LLVM IR")
|
printIR := flag.Bool("printir", false, "print LLVM IR")
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче