Skip to content

Commit b1083d7

Browse files
aykevldeadprogram
authored andcommitted
nrf: rename pwmPin to adcPin
Just a small refactor, to fix the naming.
1 parent 7863bdb commit b1083d7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/machine/machine_nrf52xxx.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,32 +116,32 @@ func (a *ADC) Configure(config ADCConfig) {
116116

117117
// Get returns the current value of an ADC pin in the range 0..0xffff.
118118
func (a *ADC) Get() uint16 {
119-
var pwmPin uint32
119+
var adcPin uint32
120120
var rawValue volatile.Register16
121121

122122
switch a.Pin {
123123
case 2:
124-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput0
124+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput0
125125
case 3:
126-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput1
126+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput1
127127
case 4:
128-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput2
128+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput2
129129
case 5:
130-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput3
130+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput3
131131
case 28:
132-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput4
132+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput4
133133
case 29:
134-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput5
134+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput5
135135
case 30:
136-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput6
136+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput6
137137
case 31:
138-
pwmPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput7
138+
adcPin = nrf.SAADC_CH_PSELP_PSELP_AnalogInput7
139139
default:
140140
return 0
141141
}
142142

143143
// Set pin to read.
144-
nrf.SAADC.CH[0].PSELP.Set(pwmPin)
144+
nrf.SAADC.CH[0].PSELP.Set(adcPin)
145145

146146
// Destination for sample result.
147147
// Note: rawValue doesn't need to be kept alive for the GC, since the

0 commit comments

Comments
 (0)