sam: return an error when an incorrect PWM pin is used

Previously it would trigger a nil pointer panic.
This commit is contained in:
Ayke van Laethem
2020-05-11 16:02:00 +02:00
committed by Ron Evans
parent b5f028e1f7
commit 38fc340802
7 changed files with 84 additions and 51 deletions
+2 -1
View File
@@ -90,7 +90,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.