Skip to content

Commit

Permalink
Update ADCSetup.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Bexin3 authored Jan 23, 2023
1 parent d1f6642 commit 6948701
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ADCSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ void AttachADC0(int ADCpin, bool IDACRefon) {

if (IDACRefon) {
ADC0->INPUTCTRL.bit.MUXNEG = 0;
ADC0->INPUTCTRL.bit.MUXPOS = ADCpin;
ADC0->INPUTCTRL.bit.MUXPOS = g_APinDescription[ADCpin].ulADCChannelNumber;
} else {
ADC0->INPUTCTRL.bit.MUXNEG = 0x18;
ADC0->INPUTCTRL.bit.MUXPOS = ADCpin;
ADC0->INPUTCTRL.bit.MUXPOS = g_APinDescription[ADCpin].ulADCChannelNumber;
};

}
Expand Down Expand Up @@ -99,10 +99,10 @@ int FastAnalogRead(int pin) {

if (mp) {
ADC0->INPUTCTRL.bit.MUXNEG = 0;
ADC0->INPUTCTRL.bit.MUXPOS = pin;
ADC0->INPUTCTRL.bit.MUXPOS = g_APinDescription[pin].ulADCChannelNumber;
} else {
ADC0->INPUTCTRL.bit.MUXNEG = 0x18;
ADC0->INPUTCTRL.bit.MUXPOS = pin;
ADC0->INPUTCTRL.bit.MUXPOS = g_APinDescription[pin].ulADCChannelNumber;
};
//while (ADC->STATUS.bit.SYNCBUSY) {};
ADC0->SWTRIG.bit.START = true; //Start reading again
Expand Down Expand Up @@ -178,10 +178,10 @@ void AttachADC1(int ADCpin, bool IDACRefon) {

if (IDACRefon) {
ADC1->INPUTCTRL.bit.MUXNEG = 0;
ADC1->INPUTCTRL.bit.MUXPOS = ADCpin;
ADC1->INPUTCTRL.bit.MUXPOS = g_APinDescription[ADCpin].ulADCChannelNumber;
} else {
ADC1->INPUTCTRL.bit.MUXNEG = 0x18;
ADC1->INPUTCTRL.bit.MUXPOS = ADCpin;
ADC1->INPUTCTRL.bit.MUXPOS = g_APinDescription[ADCpin].ulADCChannelNumber;
};

}
Expand Down

0 comments on commit 6948701

Please sign in to comment.