Oops fix screw-up in last check-in

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4183 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-12-15 01:24:36 +00:00
parent 02f39f908c
commit f9f13e3c03

View File

@ -504,27 +504,27 @@ static void adc_reset(FAR struct adc_dev_s *dev)
L = L << 20;
regval = adc_getreg(priv, STM32_ADC_SQR1_OFFSET);
regval &= ~ADC_SQR1_L_MASK; /* Clear L Mask */
regval |= L; /* SetL, # of convertions */
regval |= L; /* SetL, # of conversions */
adc_putreg(priv, STM32_ADC_SQR1_OFFSET, regval);
/* Configuration of the channels convertions */
/* Configuration of the channels conversions */
regval = adc_getreg(priv, STM32_ADC_SQR3_OFFSET) & ~ADC_SQR3_RESERVED;
if (i = 1, offset = 0; i <= priv->nchannels && i <= 6; i++, offset += 5)
for (i = 1, offset = 0; i <= priv->nchannels && i <= 6; i++, offset += 5)
{
regval |= (uint32_t)priv->chanlist[i-1] << offset;
}
adc_putreg(priv, STM32_ADC_SQR3_OFFSET, regval);
regval = adc_getreg(priv, STM32_ADC_SQR2_OFFSET) & ~ADC_SQR2_RESERVED;
if (i = 7, offset = 0; i <= priv->nchannels && i <= 12; i++, offset += 5)
for (i = 7, offset = 0; i <= priv->nchannels && i <= 12; i++, offset += 5)
{
regval |= (uint32_t)priv->chanlist[i-1] << offset;
}
adc_putreg(priv, STM32_ADC_SQR2_OFFSET, regval);
regval = adc_getreg(priv, STM32_ADC_SQR1_OFFSET) & ~ADC_SQR1_RESERVED;
if (i = 13, offset = 0; i <= priv->nchannels && i <= 16; i++, offset += 5)
for (i = 13, offset = 0; i <= priv->nchannels && i <= 16; i++, offset += 5)
{
regval |= (uint32_t)priv->chanlist[i-1] << offset;
}