From b1083d78c78a567c04a16b21c9ae013faa6be78b Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 30 Nov 2025 11:14:11 +0100 Subject: [PATCH] nrf: rename pwmPin to adcPin Just a small refactor, to fix the naming. --- src/machine/machine_nrf52xxx.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/machine/machine_nrf52xxx.go b/src/machine/machine_nrf52xxx.go index ef3c7cb77..15e7a577c 100644 --- a/src/machine/machine_nrf52xxx.go +++ b/src/machine/machine_nrf52xxx.go @@ -116,32 +116,32 @@ func (a *ADC) Configure(config ADCConfig) { // Get returns the current value of an ADC pin in the range 0..0xffff. func (a *ADC) Get() uint16 { - var pwmPin uint32 + var adcPin uint32 var rawValue volatile.Register16 switch a.Pin { case 2: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput0 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput0 case 3: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput1 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput1 case 4: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput2 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput2 case 5: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput3 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput3 case 28: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput4 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput4 case 29: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput5 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput5 case 30: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput6 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput6 case 31: - pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput7 + adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput7 default: return 0 } // Set pin to read. - nrf.SAADC.CH[0].PSELP.Set(pwmPin) + nrf.SAADC.CH[0].PSELP.Set(adcPin) // Destination for sample result. // Note: rawValue doesn't need to be kept alive for the GC, since the