Skip to content

Commit de4ef7a

Browse files
committed
fix(src/machine/nrf52xxx/adc): Register16.Get() already returns uint16, bit shifting does not make sense, <0 check neither
Signed-off-by: Paul Schroeder <milkpirate@users.noreply.github.com>
1 parent bfa1551 commit de4ef7a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/machine/machine_nrf52xxx.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,7 @@ func (a *ADC) Get() uint16 {
169169
}
170170
nrf.SAADC.EVENTS_STOPPED.Set(0)
171171

172-
value := int16(rawValue.Get())
173-
if value < 0 {
174-
value = 0
175-
}
176-
177-
// Return 16-bit result from 12-bit value.
178-
return uint16(value << 4)
172+
return rawValue.Get()
179173
}
180174

181175
// SPI on the NRF.

0 commit comments

Comments
 (0)