linguini1 commented on code in PR #18864:
URL: https://github.com/apache/nuttx/pull/18864#discussion_r3225161059


##########
arch/arm/src/at32/at32_pwm.c:
##########
@@ -2168,11 +2168,6 @@ static int pwm_duty_update(struct pwm_lowerhalf_s *dev, 
uint8_t channel,
   pwminfo("TIM%u channel: %u duty: %08" PRIx32 "\n",
           priv->timid, channel, duty);
 
-#ifndef CONFIG_PWM_MULTICHAN

Review Comment:
   Maybe we can change this to `#if CONFIG_PWM_NCHAN == 1`



##########
arch/arm/src/ht32f491x3/Kconfig:
##########
@@ -63,7 +63,7 @@ config HT32F491X3_TMR1
 config HT32F491X3_TMR1_PWM
        bool "TMR1 PWM output"
        default n
-       depends on HT32F491X3_TMR1 && PWM && !PWM_MULTICHAN

Review Comment:
   Does it matter here if we use `PWM_NCHAN == 1`?



##########
arch/arm/src/nrf53/nrf53_pwm.c:
##########
@@ -68,9 +68,6 @@ struct nrf53_pwm_s
   uint32_t                ch1_pin;   /* Channel 2 pin */
   uint32_t                ch2_pin;   /* Channel 3 pin */
   uint32_t                ch3_pin;   /* Channel 4 pin */
-#ifndef CONFIG_PWM_MULTICHAN
-  uint8_t                 channel;   /* Assigned channel */

Review Comment:
   For such things is it worth keeping the optimization by checking 
`CONFIG_PWM_NCHAN > 1`?



##########
arch/arm/src/stm32/stm32_pwm.c:
##########
@@ -2321,11 +2321,6 @@ static int pwm_duty_update(struct pwm_lowerhalf_s *dev, 
uint8_t channel,
   pwminfo("TIM%u channel: %u duty: %08" PRIx32 "\n",
           priv->timid, channel, duty);
 
-#ifndef CONFIG_PWM_MULTICHAN

Review Comment:
   Ditto



##########
arch/arm/src/stm32f7/stm32_pwm.c:
##########
@@ -1926,11 +1926,6 @@ static int pwm_duty_update(struct pwm_lowerhalf_s *dev, 
uint8_t channel,
   pwminfo("TIM%u channel: %u duty: %08" PRIx32 "\n",
           priv->timid, channel, duty);
 
-#ifndef CONFIG_PWM_MULTICHAN

Review Comment:
   Ditto



##########
arch/arm/src/stm32h5/stm32_pwm.c:
##########
@@ -1991,11 +1991,6 @@ static int pwm_duty_update(struct pwm_lowerhalf_s *dev, 
uint8_t channel,
   pwminfo("TIM%u channel: %u duty: %08" PRIx32 "\n",
           priv->timid, channel, duty);
 
-#ifndef CONFIG_PWM_MULTICHAN

Review Comment:
   Ditto



##########
arch/arm/src/stm32f0l0g0/stm32_pwm.c:
##########
@@ -884,24 +882,17 @@ static int stm32pwm_timer(struct stm32_pwmtimer_s *priv,
   ccmr2 = stm32pwm_getreg(priv, STM32_GTIM_CCMR2_OFFSET);
 #endif
 
-#if defined(CONFIG_PWM_MULTICHAN)
-  pwminfo("TIM%u frequency: %" PRIu32 "\n",
-          priv->timid, info->frequency);
-#elif defined(CONFIG_PWM_PULSECOUNT)
+#ifdef CONFIG_PWM_PULSECOUNT
   pwminfo("TIM%u channel: %u frequency: %" PRIu32 " duty: %08" PRIx32
           " count: %u\n",
           priv->timid, priv->channels[0].channel, info->frequency,
-          info->duty, info->count);
+          info->channels[0].duty, info->channels[0].count);
 #else
-  pwminfo("TIM%u channel: %u frequency: %" PRIu32 " duty: %08" PRIx32 "\n",
-          priv->timid, priv->channels[0].channel, info->frequency,
-          info->duty);
+  pwminfo("TIM%u frequency: %" PRIu32 "\n",
+          priv->timid, info->frequency);
 #endif
 
   DEBUGASSERT(info->frequency > 0);
-#ifndef CONFIG_PWM_MULTICHAN

Review Comment:
   Ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to