From ca038722e88f047a2eb0e35ef0954aebcf932791 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 20 Dec 2011 14:41:32 +0000 Subject: First round of PWM driver debug changes git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4204 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/stm32/stm32_pwm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nuttx/arch/arm/src/stm32') diff --git a/nuttx/arch/arm/src/stm32/stm32_pwm.c b/nuttx/arch/arm/src/stm32/stm32_pwm.c index 1e3f4f07d..420537ebb 100644 --- a/nuttx/arch/arm/src/stm32/stm32_pwm.c +++ b/nuttx/arch/arm/src/stm32/stm32_pwm.c @@ -70,6 +70,7 @@ * Pre-processor Definitions ****************************************************************************/ /* Debug ********************************************************************/ +/* Non-standard debug that may be enabled just for testing PWM */ #ifdef CONFIG_DEBUG_PWM # define pwmdbg dbg @@ -434,10 +435,13 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev, FAR const struct pwm_info_ uint16_t ocmode1; uint16_t ocmode2; + DEBUGASSERT(priv != NULL && info != NULL); + pwmvdbg("TIM%d channel: %d frequency: %d duty: %08x\n", priv->timid, priv->channel, info->frequency, info->duty); + DEBUGASSERT(info->frequency > 0 && info->duty > 0 && info->duty < uitoub16(100)); - /* Caculate optimal values for the timer prescaler and for the timer reload + /* Calculate optimal values for the timer prescaler and for the timer reload * register. If' frequency' is the desired frequency, then * * reload = timclk / frequency -- cgit v1.2.3