Example #1
0
func buttonHandler() {
	exti.L0.ClearPending()
	select {
	case c <- Green:
	default:
		// Signal that c is full.
		LED.SetBit(Blue)
		delay.Loop(1e5)
		LED.ClearBit(Blue)
	}
}
Example #2
0
func buttonHandler() {
	exti.L0.ClearPending()
	select {
	case c <- led:
		if led++; led > Red {
			led = Green
		}
	default:
		// Signal that c is full.
		LED.SetBit(Blue)
		delay.Loop(1e5)
		LED.ClearBit(Blue)
	}
}