[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package machine is not in GOROOT #697

Open
budzonmichal opened this issue Jul 25, 2024 · 0 comments
Open

package machine is not in GOROOT #697

budzonmichal opened this issue Jul 25, 2024 · 0 comments

Comments

@budzonmichal
Copy link
budzonmichal commented Jul 25, 2024

Regardint his thread: golang/go#43079

Some time passed, but this issue still appears:

$ go build
../../pkg/mod/tinygo.org/x/drivers@v0.28.0/st7789/st7789.go:10:2: package machine is not in GOROOT (/usr/local/go/src/machine)
../../pkg/mod/github.com/tinygo-org/tinygo@v0.32.0/src/machine/buffer.go:4:2: package runtime/volatile is not in GOROOT (/usr/local/go/src/runtime/volatile)

What is the way, any woarkaround maybe, to builds and use tinygo drivers in my project ?

use case:

package main

import (
	"image/color"

	"github.com/tinygo-org/tinygo/src/machine" // suggested workaround
// anyway I got error while importing github.com/tinygo-org/tinygo/src/machine: package runtime/volatile is not in GOROOT (/usr/local/go/src/runtime/volatile)compiler

	"tinygo.org/x/drivers/st7789"
)

func main() {

	// Example configuration for Adafruit Clue
	// machine.SPI1.Configure(machine.SPIConfig{
	//	Frequency: 8000000,
	//	SCK:       machine.TFT_SCK,
	//	SDO:       machine.TFT_SDO,
	//	SDI:       machine.TFT_SDO,
	//	Mode:      0,
	// })
	// display := st7789.New(machine.SPI1,
	//	machine.TFT_RESET,
	//	machine.TFT_DC,
	//	machine.TFT_CS,
	//	machine.TFT_LITE)

	machine.SPI0.Configure(machine.SPIConfig{
		Frequency: 8000000,
		Mode:      0,
	})
	display := st7789.New(machine.SPI0,
		machine.P6, // TFT_RESET
		machine.P7, // TFT_DC
		machine.P8, // TFT_CS
		machine.P9) // TFT_LITE

	(...)
}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant