コード例 #1
0
ファイル: ticks-cortexm.go プロジェクト: rjammala/emgo
func loadTicks() uint64 {
	aba := atomic.LoadUintptr(&ticksABA)
	for {
		barrier.Compiler()
		t := ticks[aba&1]
		barrier.Compiler()
		aba1 := atomic.LoadUintptr(&ticksABA)
		if aba == aba1 {
			return t
		}
		aba = aba1
	}
}
コード例 #2
0
ファイル: terminal.go プロジェクト: rjammala/emgo
func (t *terminal) waittx() {
	barrier.Compiler()
	for t.siz.tx != 0 {
		barrier.Compiler()
	}
}
コード例 #3
0
ファイル: delay.go プロジェクト: rjammala/emgo
// Loop can be used to perform short active delay.
func Loop(n int) {
	for n > 0 {
		n--
		barrier.Compiler()
	}
}
コード例 #4
0
ファイル: terminal.go プロジェクト: rjammala/emgo
func (t *terminal) waitrx() {
	barrier.Compiler()
	for t.siz.rx == 0 {
		barrier.Compiler()
	}
}