stm32_wwdg debug log formatting

This commit is contained in:
Fotis Panagiotopoulos 2021-03-02 13:01:42 +02:00 committed by Xiang Xiao
parent 3c0354aba6
commit f423403dfa

View File

@ -471,9 +471,9 @@ static int stm32_getstatus(FAR struct watchdog_lowerhalf_s *lower,
status->timeleft = (priv->timeout * elapsed) / (priv->reload + 1); status->timeleft = (priv->timeout * elapsed) / (priv->reload + 1);
wdinfo("Status :\n"); wdinfo("Status :\n");
wdinfo(" flags : %08x\n", status->flags); wdinfo(" flags : %08x\n", (unsigned)status->flags);
wdinfo(" timeout : %d\n", status->timeout); wdinfo(" timeout : %u\n", (unsigned)status->timeout);
wdinfo(" timeleft : %d\n", status->flags); wdinfo(" timeleft : %u\n", (unsigned)status->flags);
return OK; return OK;
} }
@ -503,14 +503,14 @@ static int stm32_settimeout(FAR struct watchdog_lowerhalf_s *lower,
int wdgtb; int wdgtb;
DEBUGASSERT(priv); DEBUGASSERT(priv);
wdinfo("Entry: timeout=%d\n", timeout); wdinfo("Entry: timeout=%u\n", (unsigned)timeout);
/* Can this timeout be represented? */ /* Can this timeout be represented? */
if (timeout < 1 || timeout > WWDG_MAXTIMEOUT) if (timeout < 1 || timeout > WWDG_MAXTIMEOUT)
{ {
wderr("ERROR: Cannot represent timeout=%d > %d\n", wderr("ERROR: Cannot represent timeout=%u > %lu\n",
timeout, WWDG_MAXTIMEOUT); (unsigned)timeout, WWDG_MAXTIMEOUT);
return -ERANGE; return -ERANGE;
} }
@ -591,8 +591,8 @@ static int stm32_settimeout(FAR struct watchdog_lowerhalf_s *lower,
priv->fwwdg = fwwdg; priv->fwwdg = fwwdg;
priv->reload = reload; priv->reload = reload;
wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n", wdinfo("wdgtb=%d fwwdg=%u reload=%u timeout=%u\n",
wdgtb, fwwdg, reload, priv->timeout); wdgtb, (unsigned)fwwdg, (unsigned)reload, (unsigned)priv->timeout);
/* Set WDGTB[1:0] bits according to calculated value */ /* Set WDGTB[1:0] bits according to calculated value */