You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "michallenc (via GitHub)" <gi...@apache.org> on 2023/03/10 16:10:04 UTC
[GitHub] [nuttx] michallenc commented on a diff in pull request #8788: imxrt_flexpwm independent output B support added
michallenc commented on code in PR #8788:
URL: https://github.com/apache/nuttx/pull/8788#discussion_r1132570711
##########
arch/arm/src/imxrt/imxrt_flexpwm.c:
##########
@@ -774,7 +806,7 @@ static int pwm_change_freq(struct pwm_lowerhalf_s *dev,
{
struct imxrt_flexpwm_s *priv = (struct imxrt_flexpwm_s *)dev;
#ifdef CONFIG_PWM_MULTICHAN
- uint8_t shift = info->channels[channel].channel - 1;
+ uint8_t shift = info->channels[channel].channel >> 1;
Review Comment:
I am not sure about this right shift. This will always result in zero, right? We need to have shift values from 0 to 4 in order to write in correct registers.
##########
arch/arm/src/imxrt/imxrt_flexpwm.c:
##########
@@ -856,7 +888,7 @@ static int pwm_set_output(struct pwm_lowerhalf_s *dev, uint8_t channel,
uint16_t period;
uint16_t width;
uint16_t regval;
- uint8_t shift = channel - 1; /* Shift submodle offset addresses */
+ uint8_t shift = channel >> 1; /* Shift submodle offset addresses */
Review Comment:
The same as above.
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org