aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_nrf52.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2020-05-11 16:02:00 +0200
committerRon Evans <[email protected]>2020-05-13 19:19:45 +0200
commit38fc340802b5d02392528d110358fc0e9074b7e8 (patch)
tree52f9f182395bb64b1bfe072cb1aacdc7b2d173ab /src/machine/machine_nrf52.go
parentb5f028e1f7ecb645069193a5278526a081a23ff6 (diff)
downloadtinygo-38fc340802b5d02392528d110358fc0e9074b7e8.tar.gz
tinygo-38fc340802b5d02392528d110358fc0e9074b7e8.zip
sam: return an error when an incorrect PWM pin is used
Previously it would trigger a nil pointer panic.
Diffstat (limited to 'src/machine/machine_nrf52.go')
-rw-r--r--src/machine/machine_nrf52.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/machine/machine_nrf52.go b/src/machine/machine_nrf52.go
index caa0c4e78..003be7a69 100644
--- a/src/machine/machine_nrf52.go
+++ b/src/machine/machine_nrf52.go
@@ -159,7 +159,8 @@ func InitPWM() {
}
// Configure configures a PWM pin for output.
-func (pwm PWM) Configure() {
+func (pwm PWM) Configure() error {
+ return nil
}
// Set turns on the duty cycle for a PWM pin using the provided value.