summaryrefslogtreecommitdiff
path: root/nuttx/drivers
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-11 18:44:12 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-01-11 18:44:12 +0000
commit61059ae472f03c43613bb05c3789636aa5061e2f (patch)
treeb56578519143faf7a8e8a9ae20ebe31073732736 /nuttx/drivers
parent856fd40ce792b3607d46fa316ca7ce6a60ecdd4f (diff)
downloadpx4-nuttx-61059ae472f03c43613bb05c3789636aa5061e2f.tar.gz
px4-nuttx-61059ae472f03c43613bb05c3789636aa5061e2f.tar.bz2
px4-nuttx-61059ae472f03c43613bb05c3789636aa5061e2f.zip
Fix the STM32 PWM driver pulse count logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4298 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers')
-rw-r--r--nuttx/drivers/pwm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nuttx/drivers/pwm.c b/nuttx/drivers/pwm.c
index 6a613f3b5..adfe0e2e8 100644
--- a/nuttx/drivers/pwm.c
+++ b/nuttx/drivers/pwm.c
@@ -322,7 +322,7 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, unsigned int oflags)
* We do these things before starting the PWM to avoid race conditions.
*/
- upper->waiting = (upper->info.count > 0) && ((oflags & O_NONBLOCK) != 0);
+ upper->waiting = (upper->info.count > 0) && ((oflags & O_NONBLOCK) == 0);
upper->started = true;
/* Invoke the bottom half method to start the pulse train */
@@ -354,6 +354,7 @@ static int pwm_start(FAR struct pwm_upperhalf_s *upper, unsigned int oflags)
{
/* Looks like we won't be waiting after all */
+ pwmvdbg("start failed: %d\n", ret);
upper->started = false;
upper->waiting = false;
}
@@ -649,6 +650,8 @@ void pwm_expired(FAR void *handle)
{
FAR struct pwm_upperhalf_s *upper = (FAR struct pwm_upperhalf_s *)handle;
+ pwmllvdbg("started: %d waiting: %d\n", upper->started, upper->waiting);
+
/* Make sure that the PWM is started */
if (upper->started)