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 -2
View File
@@ -104,8 +104,8 @@ func InitADC() {
}
// Configure configures an ADC pin to be able to read analog data.
func (a ADC) Configure() {
return // no pin specific setup on nrf52840 machine.
func (a ADC) Configure() error {
return nil // no pin specific setup on nrf52840 machine.
}
// Get returns the current value of a ADC pin in the range 0..0xffff.