Skip to content

Commit

Permalink
arch/arm/src/lpc43xx/lpc43_timer.c: Appease nxstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt authored and xiaoxiang781216 committed Nov 28, 2020
1 parent 32e6784 commit ab87669
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions arch/arm/src/lpc43xx/lpc43_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* Configuration ************************************************************/

#ifndef CONFIG_DEBUG_TIMER_INFO
Expand All @@ -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.
Expand All @@ -101,6 +103,7 @@ struct lpc43_lowerhalf_s
/****************************************************************************
* Private Function Prototypes
****************************************************************************/

/* Register operations ******************************************************/

#ifdef CONFIG_LPC43_TMR_REGDEBUG
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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));
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -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);
}
Expand All @@ -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
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit ab87669

Please sign in to comment.