Skip to content

Commit

Permalink
fix(src/machine/nrf52xxx/adc): Register16.Get() already returns uint1…
Browse files Browse the repository at this point in the history
…6, bit shifting does not make sense, <0 check neither

Signed-off-by: Paul Schroeder <[email protected]>
  • Loading branch information
milkpirate committed Jan 14, 2025
1 parent bfa1551 commit de4ef7a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/machine/machine_nrf52xxx.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,7 @@ func (a *ADC) Get() uint16 {
}
nrf.SAADC.EVENTS_STOPPED.Set(0)

value := int16(rawValue.Get())
if value < 0 {
value = 0
}

// Return 16-bit result from 12-bit value.
return uint16(value << 4)
return rawValue.Get()
}

// SPI on the NRF.
Expand Down

0 comments on commit de4ef7a

Please sign in to comment.