Improve ability to run firmware locally for dev
Esse commit está contido em:
+7
-2
@@ -1,12 +1,17 @@
|
||||
version = $(shell git describe --tags --dirty)
|
||||
host_os = $(shell go env GOOS)
|
||||
host_arch = $(shell go env GOARCH)
|
||||
|
||||
dev:
|
||||
./scripts/build.bash -version $(version) dist/dev
|
||||
./dist/dev/deploy
|
||||
|
||||
dev-local:
|
||||
go build github.com/felixge/godrone/cmd/godrone
|
||||
./godrone cmd/godrone/godrone.conf
|
||||
env \
|
||||
BUILD_OS="$(host_os)" \
|
||||
BUILD_ARCH="$(host_arch)" \
|
||||
./scripts/build.bash -version $(version) dist/local-dev
|
||||
cd dist/local-dev && ./godrone
|
||||
|
||||
dist:
|
||||
./scripts/dist.bash $(version)
|
||||
|
||||
@@ -99,6 +99,8 @@ func (g *GoDrone) Run() error {
|
||||
g.log.Info("Starting godrone")
|
||||
defer g.motorboard.Close()
|
||||
|
||||
go g.serveHttp()
|
||||
|
||||
g.motorboard.SetLeds(green)
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
g.motorboard.SetLeds(red)
|
||||
@@ -112,7 +114,6 @@ func (g *GoDrone) Run() error {
|
||||
g.motorboard.SetLeds(green)
|
||||
|
||||
go g.navboardLoop()
|
||||
go g.serveHttp()
|
||||
|
||||
sigCh := make(chan os.Signal, 1)
|
||||
signal.Notify(sigCh, syscall.SIGINT)
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/felixge/godrone/log"
|
||||
"math"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
// gyroGains are the measured gains for converting the gyroscope output into
|
||||
@@ -52,6 +53,8 @@ func (n *Navboard) NextData() (data Data, err error) {
|
||||
}()
|
||||
|
||||
if err = n.open(); err != nil {
|
||||
// Don't go too crazy on retry.
|
||||
time.Sleep(time.Second)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
React.renderComponent(
|
||||
<GoDrone
|
||||
version={Config.Version}
|
||||
wsUrl="ws://192.168.1.1/ws"
|
||||
wsUrl={'ws://'+window.location.hostname+':'+window.location.port+'/ws'}
|
||||
gamepadAxisMin={0.01}
|
||||
maxAngle={Config.MaxAngle}
|
||||
flyButton={0}
|
||||
|
||||
@@ -61,8 +61,8 @@ main() {
|
||||
GOARCH="${arch}" \
|
||||
go build -o "${out_dir}/${deploy_name}" "${deploy_pkg}"
|
||||
env \
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
GOOS="${BUILD_OS:-linux}" \
|
||||
GOARCH="${BUILD_ARCH:-arm}" \
|
||||
GOARM=7 \
|
||||
CGO_ENABLED=0 \
|
||||
go build \
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário