From a7436d9f8f1b1a4b5af84df7e1f2a166d4144554 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 22 Nov 2010 17:35:15 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2419 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'demos/ARMCM3-STM32F100-DISCOVERY-GCC/main.c') 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.*/ -- cgit v1.2.3