Merge pull request #3 from jpoirier/master

set GOMAXPROCS to core count (Go v1.5 now does this automatically)
pull/6/head
cyoung 2015-08-15 15:01:37 -04:00
commit 36a4bbcf3e
1 zmienionych plików z 37 dodań i 39 usunięć

Wyświetl plik

@ -3,12 +3,13 @@ package main
import ( import (
"bufio" "bufio"
"encoding/hex" "encoding/hex"
"encoding/json"
"fmt" "fmt"
"net" "net"
"os" "os"
"runtime"
"strings" "strings"
"time" "time"
"encoding/json"
) )
// http://www.faa.gov/nextgen/programs/adsb/wsa/media/GDL90_Public_ICD_RevA.PDF // http://www.faa.gov/nextgen/programs/adsb/wsa/media/GDL90_Public_ICD_RevA.PDF
@ -154,7 +155,6 @@ func makeOwnshipReport() bool {
msg[9] = tmp[1] // Longitude. msg[9] = tmp[1] // Longitude.
msg[10] = tmp[2] // Longitude. msg[10] = tmp[2] // Longitude.
//TODO: 0xFFF "invalid altitude." //TODO: 0xFFF "invalid altitude."
//FIXME: This is **PRESSURE ALTITUDE** //FIXME: This is **PRESSURE ALTITUDE**
@ -187,7 +187,6 @@ func makeOwnshipReport() bool {
msg[15] = msg[15] | byte((verticalVelocity&0x0F00)>>8) msg[15] = msg[15] | byte((verticalVelocity&0x0F00)>>8)
msg[16] = byte(verticalVelocity & 0xFF) msg[16] = byte(verticalVelocity & 0xFF)
// Showing magnetic (corrected) on ForeFlight. Needs to be True Heading. // Showing magnetic (corrected) on ForeFlight. Needs to be True Heading.
groundTrack := uint16(0) groundTrack := uint16(0)
if isGPSGroundTrackValid() { if isGPSGroundTrackValid() {
@ -307,7 +306,6 @@ func updateStatus() {
} }
} }
func parseInput(buf string) ([]byte, uint16) { func parseInput(buf string) ([]byte, uint16) {
x := strings.Split(buf, ";") // Discard everything after the first ';'. x := strings.Split(buf, ";") // Discard everything after the first ';'.
if len(x) == 0 { if len(x) == 0 {
@ -428,7 +426,6 @@ func managementInterface() {
} }
} }
func defaultSettings() { func defaultSettings() {
globalSettings.UAT_Enabled = true //TODO globalSettings.UAT_Enabled = true //TODO
globalSettings.ES_Enabled = false //TODO globalSettings.ES_Enabled = false //TODO
@ -474,6 +471,7 @@ func saveSettings() {
} }
func main() { func main() {
runtime.GOMAXPROCS(runtime.NumCPU()) // redundant with Go v1.5+ compiler
MsgLog = make([]msg, 0) MsgLog = make([]msg, 0)
crcInit() // Initialize CRC16 table. crcInit() // Initialize CRC16 table.