kopia lustrzana https://github.com/cyoung/stratux
Remove globalStatus.RY835AI_connected.
rodzic
bc830b0a4e
commit
d60248b660
2
Makefile
2
Makefile
|
@ -12,7 +12,7 @@ all:
|
||||||
make xgen_gdl90
|
make xgen_gdl90
|
||||||
|
|
||||||
xgen_gdl90:
|
xgen_gdl90:
|
||||||
go get -t -d -v ./main ./test ./godump978 ./mpu6050 ./uatparse
|
go get -t -d -v ./main ./test ./godump978 ./uatparse
|
||||||
go build $(BUILDINFO) -p 4 main/gen_gdl90.go main/traffic.go main/ry835ai.go main/network.go main/managementinterface.go main/sdr.go main/ping.go main/uibroadcast.go main/monotonic.go main/datalog.go main/equations.go
|
go build $(BUILDINFO) -p 4 main/gen_gdl90.go main/traffic.go main/ry835ai.go main/network.go main/managementinterface.go main/sdr.go main/ping.go main/uibroadcast.go main/monotonic.go main/datalog.go main/equations.go
|
||||||
|
|
||||||
xdump1090:
|
xdump1090:
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 56658ffe83c23fde04fccc8e747bf9b7c1e184ea
|
|
|
@ -1870,21 +1870,20 @@ func initI2C() error {
|
||||||
// Unused at the moment. 5 second update, since read functions in bmp180 are slow.
|
// Unused at the moment. 5 second update, since read functions in bmp180 are slow.
|
||||||
func tempAndPressureReader() {
|
func tempAndPressureReader() {
|
||||||
timer := time.NewTicker(5 * time.Second)
|
timer := time.NewTicker(5 * time.Second)
|
||||||
for globalStatus.RY835AI_connected && globalSettings.AHRS_Enabled {
|
for {
|
||||||
<-timer.C
|
<-timer.C
|
||||||
// Read temperature and pressure altitude.
|
// Read temperature and pressure altitude.
|
||||||
temp, alt, err_bmp180 := readBMP180()
|
temp, alt, err_bmp180 := readBMP180()
|
||||||
// Process.
|
// Process.
|
||||||
if err_bmp180 != nil {
|
if err_bmp180 != nil {
|
||||||
log.Printf("readBMP180(): %s\n", err_bmp180.Error())
|
log.Printf("readBMP180(): %s\n", err_bmp180.Error())
|
||||||
globalStatus.RY835AI_connected = false
|
return
|
||||||
} else {
|
} else {
|
||||||
mySituation.Temp = temp
|
mySituation.Temp = temp
|
||||||
mySituation.Pressure_alt = alt
|
mySituation.Pressure_alt = alt
|
||||||
mySituation.LastTempPressTime = stratuxClock.Time
|
mySituation.LastTempPressTime = stratuxClock.Time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globalStatus.RY835AI_connected = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeFFAHRSSimReport() {
|
func makeFFAHRSSimReport() {
|
||||||
|
@ -2034,7 +2033,7 @@ func isTempPressValid() bool {
|
||||||
return stratuxClock.Since(mySituation.LastTempPressTime) < 15*time.Second
|
return stratuxClock.Since(mySituation.LastTempPressTime) < 15*time.Second
|
||||||
}
|
}
|
||||||
|
|
||||||
func initAHRS() error {
|
func initI2CSensors() error {
|
||||||
if err := initI2C(); err != nil { // I2C bus.
|
if err := initI2C(); err != nil { // I2C bus.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -2048,7 +2047,7 @@ func initAHRS() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func pollRY835AI() {
|
func pollGPS() {
|
||||||
readyToInitGPS = true //TO-DO: Implement more robust method (channel control) to kill zombie serial readers
|
readyToInitGPS = true //TO-DO: Implement more robust method (channel control) to kill zombie serial readers
|
||||||
timer := time.NewTicker(4 * time.Second)
|
timer := time.NewTicker(4 * time.Second)
|
||||||
go gpsAttitudeSender()
|
go gpsAttitudeSender()
|
||||||
|
@ -2061,14 +2060,6 @@ func pollRY835AI() {
|
||||||
go gpsSerialReader()
|
go gpsSerialReader()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// RY835AI I2C enabled, was not connected previously?
|
|
||||||
if globalSettings.AHRS_Enabled && !globalStatus.RY835AI_connected {
|
|
||||||
err := initAHRS()
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("initAHRS(): %s\ndisabling AHRS sensors.\n", err.Error())
|
|
||||||
globalStatus.RY835AI_connected = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2079,5 +2070,7 @@ func initRY835AI() {
|
||||||
satelliteMutex = &sync.Mutex{}
|
satelliteMutex = &sync.Mutex{}
|
||||||
Satellites = make(map[string]SatelliteInfo)
|
Satellites = make(map[string]SatelliteInfo)
|
||||||
|
|
||||||
go pollRY835AI()
|
initI2CSensors()
|
||||||
|
|
||||||
|
go pollGPS()
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval) {
|
||||||
$scope.GPS_satellites_seen = status.GPS_satellites_seen;
|
$scope.GPS_satellites_seen = status.GPS_satellites_seen;
|
||||||
$scope.GPS_solution = status.GPS_solution;
|
$scope.GPS_solution = status.GPS_solution;
|
||||||
$scope.GPS_position_accuracy = String(status.GPS_solution ? ", " + status.GPS_position_accuracy.toFixed(1) + " m" : " ");
|
$scope.GPS_position_accuracy = String(status.GPS_solution ? ", " + status.GPS_position_accuracy.toFixed(1) + " m" : " ");
|
||||||
$scope.RY835AI_connected = status.RY835AI_connected;
|
|
||||||
$scope.UAT_METAR_total = status.UAT_METAR_total;
|
$scope.UAT_METAR_total = status.UAT_METAR_total;
|
||||||
$scope.UAT_TAF_total = status.UAT_TAF_total;
|
$scope.UAT_TAF_total = status.UAT_TAF_total;
|
||||||
$scope.UAT_NEXRAD_total = status.UAT_NEXRAD_total;
|
$scope.UAT_NEXRAD_total = status.UAT_NEXRAD_total;
|
||||||
|
|
|
@ -72,12 +72,6 @@
|
||||||
<label class="col-xs-6">GPS satellites:</label>
|
<label class="col-xs-6">GPS satellites:</label>
|
||||||
<span class="col-xs-6">{{GPS_satellites_locked}} in solution; {{GPS_satellites_seen}} seen; {{GPS_satellites_tracked}} tracked</span>
|
<span class="col-xs-6">{{GPS_satellites_locked}} in solution; {{GPS_satellites_seen}} seen; {{GPS_satellites_tracked}} tracked</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" ng-class="{'section_invisible': !visible_ahrs}">
|
|
||||||
<label class="col-xs-6">AHRS:</label>
|
|
||||||
<div id="RY835AI_connected-container" class="col-xs-6">
|
|
||||||
<div ng-class="RY835AI_connected ? 'fa fa-check-circle text-success' : 'fa fa-times-circle text-danger'"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row"><span class="col-xs-1"> </span></div>
|
<div class="row"><span class="col-xs-1"> </span></div>
|
||||||
<div class="separator"></div>
|
<div class="separator"></div>
|
||||||
<div class="row" ng-class="{'section_invisible': !visible_uat}">
|
<div class="row" ng-class="{'section_invisible': !visible_uat}">
|
||||||
|
|
Ładowanie…
Reference in New Issue