Value stored to 'adc_reading ' is never read

This code:

in the line:

adc_reading /= NO_OF_SAMPLES;

i get a Value stored to 'adc_reading ’ is never read

but in fact the Variable is read in Line 104.

how to solve ?

Hi @franz_at_zasso

Thanks for reporting this potential false positive.
I didn’t succeed in reproducing the issue on my side so do you think you could create a small reproducer for it?
To generate a reproducer file:

Add the reproducer option to the scanner configuration:
sonar.cfamily.reproducer= "Full path to the adc1_example_main.c file"
Re-running the scanner should generate a file named sonar-cfamily.reproducer in the project folder.
Please share this file (I can send you a PM if you want to share it privately)

Thank you