On AVR32EB14 using PIN_PC0 for analogue input gives a compile error
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start in variants/14pin-ebseries/pins_arduino.h and inspect the digitalPinToAnalogInput definition alongside the PIN_PC0 mapping. Reproduce the reported compile error with analogRead(PIN_PC0) on an AVR32EB14 using core 1.6.2, then verify the corrected mapping compiles successfully.
Written by the indexing model from the issue text.
Description
With core 1.6.2 compiling:
int test = analogRead(PIN_PC0);
gives the error:
/Users/david/Library/Arduino15/packages/DxCore/hardware/megaavr/1.6.2/cores/dxcore/wiring_analog.c:116:9: error: call to 'badArg'
declared with attribute error:
badArg("analogRead called with constant pin that is only capable of digital input.");
I think the problem is that in variants/14pin-ebseries/pins_arduino.h:
#define digitalPinToAnalogInput(p) (((p) >= PIN_PD4 && (p) <= PIN_PD7) ? (p) - PIN_PD0 : (((p) > PIN_PC0 && (p) <= PIN_PC3) ? (p) + 20 : NOT_A_PIN))
should be:
#define digitalPinToAnalogInput(p) (((p) >= PIN_PD4 && (p) <= PIN_PD7) ? (p) - PIN_PD0 : (((p) >= PIN_PC0 && (p) <= PIN_PC3) ? (p) + 20 : NOT_A_PIN))
- Dominant language
- C
- Stars
- 237
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SpenceKonde/DxCore
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SpenceKonde/DxCore#655 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
SpenceKonde/DxCore#654 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
SpenceKonde/DxCore#648 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
SpenceKonde/DxCore#646 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
SpenceKonde/DxCore#642 ·
All issues in SpenceKonde/DxCore
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100