LPC17xx: DC updates from Max. Also fixes some syntax errors that I introduced in the last commit.
This commit is contained in:
parent
dd4be66f1c
commit
99927e918d
@ -421,9 +421,7 @@ static int adc_interrupt(int irq, void *context)
|
||||
FAR struct up_dev_s *priv = (FAR struct up_dev_s *)g_adcdev.ad_priv;
|
||||
volatile uint32_t regVal, regVal2, regVal3;
|
||||
|
||||
//lpc17_gpiowrite(LPCXPRESSO_GPIO0_21, 1); /* Set pin P0.21 */
|
||||
|
||||
/* Teste si une interruption a bien eu lieu */
|
||||
/* Verify that an interrupt has actually occured */
|
||||
|
||||
regVal2 = getreg32(LPC17_ADC_STAT); /* Read ADSTAT will clear the interrupt flag */
|
||||
if ((regVal2) & (1<<16))
|
||||
@ -431,6 +429,7 @@ static int adc_interrupt(int irq, void *context)
|
||||
if ((priv->mask & 0x01) != 0)
|
||||
{
|
||||
regVal = getreg32(LPC17_ADC_DR0);
|
||||
|
||||
#ifdef CONFIG_ADC_DIRECT_ACCESS
|
||||
/* Store the data value plus the status bits */
|
||||
|
||||
@ -451,14 +450,6 @@ static int adc_interrupt(int irq, void *context)
|
||||
|
||||
#endif /* CONFIG_ADC_WORKER_THREAD */
|
||||
#endif /* CONFIG_ADC_DIRECT_ACCESS */
|
||||
|
||||
#ifdef CONFIG_ADC_DEBUG_DAC
|
||||
/* Adjust the binary value to the lpc1768's register format (plus high
|
||||
* speed profile in bit 16)
|
||||
*/
|
||||
|
||||
// putreg32(((((regVal >> 4) & 0xFFF) << 6)| 0x10000) & 0xffff, LPC17_DAC_CR);
|
||||
#endif /*CONFIG_ADC_DEBUG_DAC*/
|
||||
}
|
||||
|
||||
if ((priv->mask & 0x02) != 0)
|
||||
@ -515,13 +506,6 @@ static int adc_interrupt(int irq, void *context)
|
||||
#endif /*CONFIG_ADC_DIRECT_ACCESS*/
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ADC_WORKER_THREAD
|
||||
/* Store the data value plus the status bits */
|
||||
|
||||
ADC2Buffer0[0] = regVal;
|
||||
ADC0IntDone = 1;
|
||||
|
||||
#else /* CONFIG_ADC_WORKER_THREAD */
|
||||
if ((priv->mask & 0x08) != 0)
|
||||
{
|
||||
regVal = getreg32(LPC17_ADC_DR3);
|
||||
@ -567,14 +551,15 @@ static int adc_interrupt(int irq, void *context)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /*CONFIG_ADC_WORKER_THREAD*/
|
||||
#ifdef CONFIG_ADC_WORKER_THREAD
|
||||
if (ADC0IntDone == 1)
|
||||
{
|
||||
work_queue(HPWORK, &priv->irqwork, (worker_t)adc_irqworker, (FAR void *)priv, 0);
|
||||
work_queue(HPWORK, &priv->irqwork, (worker_t)adc_irqworker,
|
||||
(FAR void *)priv, 0);
|
||||
}
|
||||
|
||||
#endif /*CONFIG_ADC_WORKER_THREAD*/
|
||||
}
|
||||
|
||||
regVal3 = getreg32(LPC17_ADC_GDR); /* Read ADGDR clear the DONE and OVERRUN bits */
|
||||
putreg32((priv->mask) | /* Select channels 0 to 7 on ADC0 */
|
||||
|
@ -1317,6 +1317,7 @@ static void lpc17_polltimer(int argc, uint32_t arg, ...)
|
||||
lpc17_rxdone(priv);
|
||||
|
||||
#endif /*CONFIG_NET_WORKER_THREAD*/
|
||||
}
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user