Example #1
0
func main() {
	C.setup()
	//avgDelay, avgJitter := calculateDelayJitter()
	calculateDelayJitter()
	//fmt.Printf("Avg. Delay = %v ns\n", avgDelay)
	//fmt.Printf("Avg. Jitter = %v ns\n", avgJitter)
	//priority_test(f, avgDelay)
}
Example #2
0
func Setup(pin int) error {
	success := C.setup(C.int(pin))

	if success != 0 {
		return errors.New("Unable to initalize, are you root?")
	}

	setup = true
	return nil
}
Example #3
0
func main() {

	initGTK()

	flag.Parse()
	fmt.Println("Remaining flag.Args():", flag.Args())

	go C.setup()

	for {
		m := <-msgCh
		fmt.Println(m.ms)
		if m.id == 0 {
			break
		}
	}
}
Example #4
0
func main() {
	/*usb, err := openPort("/dev/ttyUSB0")
	if err != nil {
		fmt.Printf("Failed to open the serial port!")
		return
	}
	//pin 12 and pin 15 from P9 on BBB
	//pin 12 = gpio60
	//pin 15 = gpio48
	led_blue, err := os.OpenFile("/sys/class/gpio/gpio48/value", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
	if err != nil {
		fmt.Printf("error occured: %v\n", err)
		return
	}
	led_green, err := os.OpenFile("/sys/class/gpio/gpio60/value", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
	if err != nil {
		fmt.Printf("error occured: %v\n", err)
		return
	}
	turnOn(led_blue)
	turnOff(led_green)
	//avgDelay, avgJitter := calculateDelayJitter(usb)
	//calculateDelayJitter(usb)
	//fmt.Printf("Avg. Delay = %v ns\n", avgDelay)
	//fmt.Printf("Avg. Jitter = %v ns\n", avgJitter)
	//windowSize := int64(600000000) //cycles at 1ghz is 0.6s
	//waitTime := int64(500000000)   //cycles at 1ghz is 0.5s
	//time.Sleep(1*time.Second)
	//priority_test(usb, windowSize, waitTime, led_blue, led_green)
	//usb.Close()
	led_blue.Close()
	led_green.Close()
	*/
	C.setup()
	calculateDelayJitter()
}
Example #5
0
func Setup() {
	C.setup()
}