From 2a1e58940ac41d9b9aaeecb77e61cd9f5fa0e6c8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 29 Nov 2020 11:50:29 +0900 Subject: [PATCH] arch/arm/src/cxd56xx/cxd56_pwm.c: Fix syslog formats --- arch/arm/src/cxd56xx/cxd56_pwm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/arm/src/cxd56xx/cxd56_pwm.c b/arch/arm/src/cxd56xx/cxd56_pwm.c index 1238d284881..4e7526d4e87 100644 --- a/arch/arm/src/cxd56xx/cxd56_pwm.c +++ b/arch/arm/src/cxd56xx/cxd56_pwm.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -250,8 +251,9 @@ static int convert_freq2period(uint32_t freq, ub16_t duty, uint32_t *param, if ((freq > ((pwmfreq + 1) >> 1)) || (freq <= 0)) { - pwmerr("Frequency out of range. %d [Effective range:%d - %d]\n", - freq, 1, (pwmfreq + 1) >> 1); + pwmerr("Frequency out of range. %" PRId32 + " [Effective range:%d - %" PRId32 "]\n", + freq, 1, (pwmfreq + 1) >> 1); return -1; } @@ -259,7 +261,7 @@ static int convert_freq2period(uint32_t freq, ub16_t duty, uint32_t *param, if ((duty < 0x00000001) || (duty > 0x0000ffff)) { - pwmerr("Duty out of range. %d\n", duty); + pwmerr("Duty out of range. %" PRId32 "\n", duty); return -1; } @@ -297,7 +299,7 @@ static int convert_freq2period(uint32_t freq, ub16_t duty, uint32_t *param, offperiod = ((0x10000 - duty) * period + (1 << (16 - prescale))) >> 16; if (offperiod < 2) { - pwmerr("Duty out of range. %d\n", duty); + pwmerr("Duty out of range. %" PRId32 "\n", duty); return -1; } } @@ -311,12 +313,14 @@ static int convert_freq2period(uint32_t freq, ub16_t duty, uint32_t *param, offperiod = period; } - pwminfo("Cycle = %d, Low = %d, High = %d, Clock = %d Hz\n", + pwminfo("Cycle = %" PRId32 ", Low = %" PRId32 + ", High = %" PRId32 ", Clock = %" PRId32 " Hz\n", (prescale) ? (period << prescale) : period + 1, (prescale) ? (offperiod << prescale) - 1 : offperiod, (prescale) ? (period << prescale) - (offperiod << prescale) + 1 : period + 1 - offperiod, pwmfreq); - pwminfo("period/off/on = 0x%04x/0x%04x/0x%04x, prescale = %d\n", + pwminfo("period/off/on = 0x%04" PRIx32 "/0x%04" PRIx32 + "/0x%04" PRIx32 ", prescale = %" PRId32 "\n", period, offperiod, period - offperiod, prescale); *param = (period & 0xffff) | @@ -533,7 +537,7 @@ FAR struct pwm_lowerhalf_s *cxd56_pwminitialize(uint32_t channel) break; #endif default: - pwmerr("Illeagal channel number:%d\n", channel); + pwmerr("Illeagal channel number:%" PRId32 "\n", channel); return NULL; }