Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

adc_disable_channel_differential_input does not correctly set config bit

Open
#102 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
c
Domain
embedded-iot

Research direction

Start in system/libsam/source/adc.c at lines 632-635 and inspect adc_disable_channel_differential_input alongside adc_enable_channel_differential_input. Verify the register mask behavior using the issue's truth table, then confirm that disabling a channel after enabling differential input clears the differential-input configuration.

Written by the indexing model from the issue text.

Description

https://github.com/arduino/ArduinoCore-sam/blob/c893c62ec9953ed36a256b5243272fda2e473c14/system/libsam/source/adc.c#L632-L635

By ORing with the previous value, the resulting of ANDing with the mask is undone, so the function results in no action being taken (once adc_enable_channel_differential_input is run, adc_disable_channel_differential_input doesn't work).
trivially with one bit, the truth table for (A and B) or A is:

A B (A and B) or A
T T T
T F T
F T F
F F F

I believe the desired result could be obtained by ORing with the set value (basically running adc_enable_channel_differential_input), then XORing with the same value, but I'm not a good enough C programmer to know if this is the optimal way to do this.

Dominant language
HTML
Stars
91
Forks
112
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from arduino/ArduinoCore-sam

All issues in arduino/ArduinoCore-sam

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.