Skip to content

Commit 7c4e83f

Browse files
aykevldeadprogram
authored andcommitted
machine: clarify caller's responsibility in SetInterrupt
1 parent db27541 commit 7c4e83f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/machine/machine_atsamd21.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ func findPinPadMapping(sercom uint8, pin Pin) (pinMode PinMode, pad uint32, ok b
165165
}
166166

167167
// SetInterrupt sets an interrupt to be executed when a particular pin changes
168-
// state.
168+
// state. The pin should already be configured as an input, including a pull up
169+
// or down if no external pull is provided.
169170
//
170171
// This call will replace a previously set callback on this pin. You can pass a
171172
// nil func to unset the pin change interrupt. If you do so, the change

src/machine/machine_atsamd51.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ func findPinPadMapping(sercom uint8, pin Pin) (pinMode PinMode, pad uint32, ok b
353353
}
354354

355355
// SetInterrupt sets an interrupt to be executed when a particular pin changes
356-
// state.
356+
// state. The pin should already be configured as an input, including a pull up
357+
// or down if no external pull is provided.
357358
//
358359
// This call will replace a previously set callback on this pin. You can pass a
359360
// nil func to unset the pin change interrupt. If you do so, the change

src/machine/machine_k210.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ func (p Pin) Get() bool {
172172
var pinCallbacks [32]func(Pin)
173173

174174
// SetInterrupt sets an interrupt to be executed when a particular pin changes
175-
// state.
175+
// state. The pin should already be configured as an input, including a pull up
176+
// or down if no external pull is provided.
176177
//
177178
// You can pass a nil func to unset the pin change interrupt. If you do so,
178179
// the change parameter is ignored and can be set to any value (such as 0).

src/machine/machine_nrf.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ func (p Pin) Get() bool {
7272
}
7373

7474
// SetInterrupt sets an interrupt to be executed when a particular pin changes
75-
// state.
75+
// state. The pin should already be configured as an input, including a pull up
76+
// or down if no external pull is provided.
7677
//
7778
// This call will replace a previously set callback on this pin. You can pass a
7879
// nil func to unset the pin change interrupt. If you do so, the change

0 commit comments

Comments
 (0)