From ab876691331c145e722c800c54b9e325cace5499 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 28 Nov 2020 09:52:24 +0900 Subject: [PATCH] arch/arm/src/lpc43xx/lpc43_timer.c: Appease nxstyle --- arch/arm/src/lpc43xx/lpc43_timer.c | 32 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/arch/arm/src/lpc43xx/lpc43_timer.c b/arch/arm/src/lpc43xx/lpc43_timer.c index de4633f816..8b6109a580 100644 --- a/arch/arm/src/lpc43xx/lpc43_timer.c +++ b/arch/arm/src/lpc43xx/lpc43_timer.c @@ -61,6 +61,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_DEBUG_TIMER_INFO @@ -77,6 +78,7 @@ /**************************************************************************** * Private Types ****************************************************************************/ + /* This structure provides the private representation of the "lower-half" * driver state structure. This structure must be cast-compatible with the * timer_lowerhalf_s structure. @@ -101,6 +103,7 @@ struct lpc43_lowerhalf_s /**************************************************************************** * Private Function Prototypes ****************************************************************************/ + /* Register operations ******************************************************/ #ifdef CONFIG_LPC43_TMR_REGDEBUG @@ -202,7 +205,7 @@ static uint32_t lpc43_getreg(uint32_t addr) { /* Yes.. then show how many times the value repeated */ - tmrinfo("[repeats %d more times]\n", count-3); + tmrinfo("[repeats %d more times]\n", count - 3); } /* Save the new address, value, and count */ @@ -339,7 +342,7 @@ void tmr_clk_disable(uint16_t tmrid) static int lpc43_interrupt(int irq, FAR void *context, FAR void *arg) { uint8_t chan_int = 0x0f; - FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq-LPC43M4_IRQ_TIMER0]; + FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq - LPC43M4_IRQ_TIMER0]; tmrinfo("Entry\n"); DEBUGASSERT((irq >= LPC43M4_IRQ_TIMER0) && (irq <= LPC43M4_IRQ_TIMER3)); @@ -358,7 +361,7 @@ static int lpc43_interrupt(int irq, FAR void *context, FAR void *arg) { /* Calculate new ticks / dither adjustment */ - priv->clkticks =((uint64_t)(priv->adjustment + priv->timeout)) * + priv->clkticks = ((uint64_t)(priv->adjustment + priv->timeout)) * TMR_FCLK / 1000000; /* Set next interval interval. TODO: make sure the interval is not @@ -398,8 +401,8 @@ static int lpc43_interrupt(int irq, FAR void *context, FAR void *arg) * Start the timer, resetting the time to the current timeout, * * Input Parameters: - * lower - A pointer the publicly visible representation of the "lower-half" - * driver state structure. + * lower - A pointer the publicly visible representation of the + * "lower-half" driver state structure. * * Returned Value: * Zero on success; a negated errno value on failure. @@ -462,8 +465,8 @@ static int lpc43_start(FAR struct timer_lowerhalf_s *lower) * Stop the timer * * Input Parameters: - * lower - A pointer the publicly visible representation of the "lower-half" - * driver state structure. + * lower - A pointer the publicly visible representation of the + * "lower-half" driver state structure. * * Returned Value: * Zero on success; a negated errno value on failure. @@ -541,6 +544,7 @@ static int lpc43_getstatus(FAR struct timer_lowerhalf_s *lower, status->timeout = priv->timeout; /* Get the time remaining until the timer expires (in microseconds) */ + /* TODO - check on the +1 in the time left calculation */ elapsed = lpc43_getreg(priv->base + LPC43_TMR_TC_OFFSET); @@ -621,8 +625,8 @@ static int lpc43_settimeout(FAR struct timer_lowerhalf_s *lower, * Call this user provided timeout callback. * * Input Parameters: - * lower - A pointer the publicly visible representation of the "lower-half" - * driver state structure. + * lower - A pointer the publicly visible representation of the + * "lower-half" driver state structure. * newcallback - The new timer expiration function pointer. If this * function pointer is NULL, then the reset-on-expiration * behavior is restored, @@ -646,8 +650,8 @@ static void lpc43_setcallback(FAR struct timer_lowerhalf_s *lower, /* Save the new callback and its argument */ - priv->callback = callback; - priv->arg = arg; + priv->callback = callback; + priv->arg = arg; leave_critical_section(flags); } @@ -660,8 +664,8 @@ static void lpc43_setcallback(FAR struct timer_lowerhalf_s *lower, * are forwarded to the lower half driver through this method. * * Input Parameters: - * lower - A pointer the publicly visible representation of the "lower-half" - * driver state structure. + * lower - A pointer the publicly visible representation of the + * "lower-half" driver state structure. * cmd - The ioctl command value * arg - The optional argument that accompanies the 'cmd'. The * interpretation of this argument depends on the particular @@ -707,7 +711,7 @@ static int lpc43_ioctl(FAR struct timer_lowerhalf_s *lower, int cmd, void lpc43_tmrinitialize(FAR const char *devpath, int irq) { - FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq-LPC43M4_IRQ_TIMER0]; + FAR struct lpc43_lowerhalf_s *priv = &g_tmrdevs[irq - LPC43M4_IRQ_TIMER0]; tmrinfo("Entry: devpath=%s\n", devpath); DEBUGASSERT((irq >= LPC43M4_IRQ_TIMER0) && (irq <= LPC43M4_IRQ_TIMER3));