Skip to content

driver: adc: adc_raw_to_millivolts not usable with 24bit ADC resolution #81363

@faloj

Description

@faloj

With 24 bits ADC readings overflow can occurs in adc_raw_to_millivolts as the internal calculation is done on a 32 bits integer.

This is fixed by using a 64 bits integer but this also requires adc_gain_invert to take a int64_t* instead of an int32t* a it's second argument, therefore slightly changing the adc API.

What are your thoughts on this ?

Metadata

Metadata

Assignees

Labels

Stalearea: ADCAnalog-to-Digital Converter (ADC)bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions