From f7d942a455d4b8b44aa982f86c14e8ff9da06b00 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 1 Dec 2020 11:38:21 +0900 Subject: [PATCH] arch/arm/src/stm32l4/stm32l4_pwm.c: Fix syslog formats --- arch/arm/src/stm32l4/stm32l4_pwm.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/arm/src/stm32l4/stm32l4_pwm.c b/arch/arm/src/stm32l4/stm32l4_pwm.c index 61813230fa..f16856077f 100644 --- a/arch/arm/src/stm32l4/stm32l4_pwm.c +++ b/arch/arm/src/stm32l4/stm32l4_pwm.c @@ -41,6 +41,7 @@ #include +#include #include #include #include @@ -1819,7 +1820,7 @@ static int pwm_duty_update(FAR struct pwm_lowerhalf_s *dev, uint8_t channel, DEBUGASSERT(priv != NULL); - pwminfo("TIM%u channel: %u duty: %08x\n", + pwminfo("TIM%u channel: %u duty: %08" PRIx32 "\n", priv->timid, channel, duty); #ifndef CONFIG_STM32L4_PWM_MULTICHAN @@ -1838,7 +1839,7 @@ static int pwm_duty_update(FAR struct pwm_lowerhalf_s *dev, uint8_t channel, ccr = b16toi(duty * reload + b16HALF); - pwminfo("ccr: %u\n", ccr); + pwminfo("ccr: %" PRIu32 "\n", ccr); /* Write corresponding CCR register */ @@ -1979,8 +1980,8 @@ static int pwm_frequency_update(FAR struct pwm_lowerhalf_s *dev, reload--; } - pwminfo("TIM%u PCLK: %u frequency: %u TIMCLK: %u " - "prescaler: %u reload: %u\n", + pwminfo("TIM%u PCLK: %" PRIu32 " frequency: %" PRIu32 " TIMCLK: %" PRIu32 + " prescaler: %" PRIu32 " reload: %" PRIu32 "\n", priv->timid, priv->pclk, frequency, timclk, prescaler, reload); /* Set the reload and prescaler values */ @@ -3178,7 +3179,7 @@ static int pwm_timer(FAR struct pwm_lowerhalf_s *dev, pwminfo("TIM%u frequency: %u\n", priv->timid, info->frequency); #else - pwminfo("TIM%u channel: %u frequency: %u duty: %08x\n", + pwminfo("TIM%u channel: %u frequency: %" PRIu32 " duty: %08" PRIx32 "\n", priv->timid, priv->channels[0].channel, info->frequency, info->duty); #endif @@ -3757,7 +3758,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) if (priv->channels[i].out1.in_use == 1) { pincfg = priv->channels[i].out1.pincfg; - pwminfo("pincfg: %08x\n", pincfg); + pwminfo("pincfg: %08" PRIx32 "\n", pincfg); stm32l4_configgpio(pincfg); pwm_dumpgpio(pincfg, "PWM setup"); @@ -3767,7 +3768,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev) if (priv->channels[i].out2.in_use == 1) { pincfg = priv->channels[i].out2.pincfg; - pwminfo("pincfg: %08x\n", pincfg); + pwminfo("pincfg: %08" PRIx32 "\n", pincfg); stm32l4_configgpio(pincfg); pwm_dumpgpio(pincfg, "PWM setup"); @@ -3842,7 +3843,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) pincfg = priv->channels[i].out1.pincfg; if (pincfg != 0) { - pwminfo("pincfg: %08x\n", pincfg); + pwminfo("pincfg: %08" PRIx32 "\n", pincfg); pincfg &= (GPIO_PORT_MASK | GPIO_PIN_MASK); pincfg |= GPIO_INPUT | GPIO_FLOAT; @@ -3854,7 +3855,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev) pincfg = priv->channels[i].out2.pincfg; if (pincfg != 0) { - pwminfo("pincfg: %08x\n", pincfg); + pwminfo("pincfg: %08" PRIx32 "\n", pincfg); pincfg &= (GPIO_PORT_MASK | GPIO_PIN_MASK); pincfg |= GPIO_INPUT | GPIO_FLOAT; @@ -4110,7 +4111,8 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev) putreg32(regval, regaddr); leave_critical_section(flags); - pwminfo("regaddr: %08x resetbit: %08x\n", regaddr, resetbit); + pwminfo("regaddr: %08" PRIx32 " resetbit: %08" PRIx32 "\n", + regaddr, resetbit); pwm_dumpregs(dev, "After stop"); return OK; }