aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Otto2010-03-26 17:35:15 +0100
committerThomas Otto2010-03-26 17:35:15 +0100
commit0f710dd8fa1a12150cb17df6f103f8864e576e0d (patch)
tree46df69e978bf62dc775fe86345806d1c44eb4b78 /lib
parent2bada0dacd561a2e36a90667ff51054af7a7cf62 (diff)
Fixed settings of groups in adc.c.
Diffstat (limited to 'lib')
-rw-r--r--lib/adc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/adc.c b/lib/adc.c
index b47e483..8723996 100644
--- a/lib/adc.c
+++ b/lib/adc.c
@@ -350,7 +350,7 @@ void adc_set_regular_sequence(u32 adc, u8 length, u8 channel[])
if ((i>12) & (i<=16))
reg32_1 |= (channel[i-12-1] << ((i-12-1) * 5));
}
- reg32_1 |= (length << ADC_SQR1_L_LSB);
+ reg32_1 |= ((length -1) << ADC_SQR1_L_LSB);
ADC_SQR1(adc) = reg32_1;
ADC_SQR2(adc) = reg32_2;
@@ -369,7 +369,7 @@ void adc_set_injected_sequence(u32 adc, u8 length, u8 channel[])
for (i=1; i<=length; i++) {
reg32 |= (channel[i-1] << ((i-1) * 5));
}
- reg32 |= (length << ADC_JSQR_JL_LSB);
+ reg32 |= ((length-1) << ADC_JSQR_JL_LSB);
ADC_JSQR(adc) = reg32;
}