Improve ability to run firmware locally for dev

Esse commit está contido em:
Felix Geisendörfer
2014-02-01 15:21:02 +01:00
commit 59e3907725
5 arquivos alterados com 15 adições e 6 exclusões
+7 -2
Ver Arquivo
@@ -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)
+2 -1
Ver Arquivo
@@ -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)
+3
Ver Arquivo
@@ -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
}
+1 -1
Ver Arquivo
@@ -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}
+2 -2
Ver Arquivo
@@ -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 \