aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-11-22 17:35:15 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-11-22 17:35:15 +0000
commita7436d9f8f1b1a4b5af84df7e1f2a166d4144554 (patch)
tree36b9f1861a3548410fb884374e58821dd81c3a9b /demos
parentdf85f0e666836fed89b9bdf6f4c1418e2b00d5ba (diff)
downloadChibiOS-a7436d9f8f1b1a4b5af84df7e1f2a166d4144554.tar.gz
ChibiOS-a7436d9f8f1b1a4b5af84df7e1f2a166d4144554.tar.bz2
ChibiOS-a7436d9f8f1b1a4b5af84df7e1f2a166d4144554.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2419 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c b/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c
index c413e7986..78cb48340 100644
--- a/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c
+++ b/demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c
@@ -101,6 +101,7 @@ static void pwmpcb(PWMDriver *pwmp) {
operation.*/
avg_ch1 = (samples[0] + samples[2] + samples[4] + samples[6]) / 4;
avg_ch2 = (samples[1] + samples[3] + samples[5] + samples[7]) / 4;
+
chSysLockFromIsr();
/* Changes the channels pulse width, the change will be effective
@@ -108,6 +109,7 @@ static void pwmpcb(PWMDriver *pwmp) {
pwmEnableChannelI(pwmp, 2, PWM_FRACTION_TO_WIDTH(pwmp, 4096, avg_ch1));
pwmEnableChannelI(pwmp, 3, PWM_FRACTION_TO_WIDTH(pwmp, 4096, avg_ch2));
+
/* Starts an asynchronous ADC conversion operation, the conversion
will be executed in parallel to the current PWM cycle and will
terminate before the next PWM cycle.*/