Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading PADC_VREF #156

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cores/arduino/pins_arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ WEAK uint32_t pinNametoDigitalPin(PinName p)
PinName analogInputToPinName(uint32_t pin)
{
PinName pn = digitalPinToPinName(analogInputToDigitalPin(pin));
// MMOLE 240330: Don't know what's going on, but PADC_VREF maps to PA_1 instead of just PADC_VREF
// --->>>
#ifdef ADC_MODULE_ENABLED
if(pin==PADC_VREF)
return(PADC_VREF);
#endif
// <<<---
if (pn == NC) {
switch (pin) {
#if defined(ADC_CHANNEL_TEMPSENSOR) || defined(ADC_CHANNEL_TEMPSENSOR_ADC1)
Expand Down