We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0394de commit 8245dcbCopy full SHA for 8245dcb
rp2-pio/statemachine.go
@@ -48,7 +48,7 @@ func (sm StateMachine) StateMachineIndex() uint8 { return sm.index }
48
49
// IsValid returns true if state machine is a valid instance.
50
func (sm StateMachine) IsValid() bool {
51
- return (sm.pio.hw == rp.PIO0 || sm.pio.hw == rp.PIO1) && sm.index <= 3
+ return sm.pio != nil && (sm.pio.hw == rp.PIO0 || sm.pio.hw == rp.PIO1) && sm.index <= 3
52
}
53
54
// Init initializes the state machine
0 commit comments