Skip to content

Commit 13a389d

Browse files
committed
fix merge errors
1 parent 657d339 commit 13a389d

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/current_sense/hardware_specific/samd21_mcu.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ static void adcStopWithDMA(void);
7272
static void adcStartWithDMA(void);
7373

7474
/**
75-
<<<<<<< HEAD
76-
* @brief ADC sync wait
77-
=======
7875
* @brief ADC sync wait
79-
>>>>>>> dev
8076
* @retval void
8177
*/
8278
static __inline__ void ADCsync() __attribute__((always_inline, unused));
@@ -86,15 +82,9 @@ static void ADCsync() {
8682

8783
// ADC DMA sequential free running (6) with Interrupts /////////////////
8884

89-
<<<<<<< HEAD
90-
SAMDCurrentSenseADCDMA * SAMDCurrentSenseADCDMA::getHardwareAPIInstance()
91-
{
92-
93-
=======
9485
SAMDCurrentSenseADCDMA * SAMDCurrentSenseADCDMA::getHardwareAPIInstance()
9586
{
9687

97-
>>>>>>> dev
9888
return &instance;
9989
}
10090

@@ -146,11 +136,7 @@ float SAMDCurrentSenseADCDMA::toVolts(uint16_t counts) {
146136
}
147137

148138
void SAMDCurrentSenseADCDMA::initPins(){
149-
<<<<<<< HEAD
150-
151-
=======
152139

153-
>>>>>>> dev
154140
pinMode(pinAREF, INPUT);
155141
pinMode(pinA, INPUT);
156142
pinMode(pinB, INPUT);
@@ -159,11 +145,7 @@ void SAMDCurrentSenseADCDMA::initPins(){
159145
uint32_t ainB = g_APinDescription[pinB].ulADCChannelNumber;
160146
firstAIN = min(ainA, ainB);
161147
lastAIN = max(ainA, ainB);
162-
<<<<<<< HEAD
163-
if( _isset(pinC) )
164-
=======
165148
if( _isset(pinC) )
166-
>>>>>>> dev
167149
{
168150
uint32_t ainC = g_APinDescription[pinC].ulADCChannelNumber;
169151
pinMode(pinC, INPUT);
@@ -178,23 +160,13 @@ void SAMDCurrentSenseADCDMA::initPins(){
178160

179161
void SAMDCurrentSenseADCDMA::initADC(){
180162

181-
<<<<<<< HEAD
182-
analogRead(pinA); // do some pin init pinPeripheral()
183-
analogRead(pinB); // do some pin init pinPeripheral()
184-
analogRead(pinC); // do some pin init pinPeripheral()
185-
186-
ADC->CTRLA.bit.ENABLE = 0x00; // Disable ADC
187-
ADCsync();
188-
//ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC0_Val; // 2.2297f V Supply VDDANA
189-
=======
190163
analogRead(pinA); // do some pin init pinPeripheral()
191164
analogRead(pinB); // do some pin init pinPeripheral()
192165
analogRead(pinC); // do some pin init pinPeripheral()
193166

194167
ADC->CTRLA.bit.ENABLE = 0x00; // Disable ADC
195168
ADCsync();
196169
//ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC0_Val; // 2.2297 V Supply VDDANA
197-
>>>>>>> dev
198170
ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain select as 1X
199171
// ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_DIV2_Val; // default
200172
ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA;
@@ -243,11 +215,7 @@ void SAMDCurrentSenseADCDMA::initADC(){
243215
*/
244216
ADC->INPUTCTRL.bit.MUXPOS = oneBeforeFirstAIN;
245217
ADCsync();
246-
<<<<<<< HEAD
247-
ADC->INPUTCTRL.bit.INPUTSCAN = lastAIN; // so the adc will scan from oneBeforeFirstAIN to lastAIN (inclusive)
248-
=======
249218
ADC->INPUTCTRL.bit.INPUTSCAN = lastAIN; // so the adc will scan from oneBeforeFirstAIN to lastAIN (inclusive)
250-
>>>>>>> dev
251219
ADCsync();
252220
ADC->INPUTCTRL.bit.INPUTOFFSET = 0; //input scan cursor
253221
ADCsync();
@@ -278,15 +246,9 @@ void SAMDCurrentSenseADCDMA::adcToDMATransfer(void *rxdata, uint32_t hwords) {
278246
DMAC->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE;
279247
DMAC->CHCTRLA.reg = DMAC_CHCTRLA_SWRST;
280248
DMAC->SWTRIGCTRL.reg &= (uint32_t)(~(1 << channelDMA));
281-
<<<<<<< HEAD
282-
283-
DMAC->CHCTRLB.reg = DMAC_CHCTRLB_LVL(0)
284-
| DMAC_CHCTRLB_TRIGSRC(ADC_DMAC_ID_RESRDY)
285-
=======
286249

287250
DMAC->CHCTRLB.reg = DMAC_CHCTRLB_LVL(0)
288251
| DMAC_CHCTRLB_TRIGSRC(ADC_DMAC_ID_RESRDY)
289-
>>>>>>> dev
290252
| DMAC_CHCTRLB_TRIGACT_BEAT;
291253
DMAC->CHINTENSET.reg = DMAC_CHINTENSET_MASK ; // enable all 3 interrupts
292254
descriptor.descaddr = 0;
@@ -327,11 +289,7 @@ void adcStartWithDMA(void){
327289
ADCsync();
328290
ADC->SWTRIG.bit.FLUSH = 1;
329291
ADCsync();
330-
<<<<<<< HEAD
331-
ADC->CTRLA.bit.ENABLE = 0x01;
332-
=======
333292
ADC->CTRLA.bit.ENABLE = 0x01;
334-
>>>>>>> dev
335293
ADCsync();
336294
}
337295

0 commit comments

Comments
 (0)