mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 16:59:28 +08:00
up_timer_initialize() is named incorrectly. The prefix should be the architecture name, not up_ since it is private to the architecture. up_timerisr() is similarly misnamed and should also be private since it is used only with the xyz_timerisr.c files. Also updat TODO list.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<h1><big><font color="#3c34ec">
|
<h1><big><font color="#3c34ec">
|
||||||
<i>NuttX RTOS Porting Guide</i>
|
<i>NuttX RTOS Porting Guide</i>
|
||||||
</font></big></h1>
|
</font></big></h1>
|
||||||
<p>Last Updated: August 31, 2016</p>
|
<p>Last Updated: February 7, 2017</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -2324,7 +2324,7 @@ config ARCH_SIM
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="#uptimerinit"><code>up_timer_initialize()</code></a>:
|
<a href="#uptimerinit"><i><arch></i><code>_timer_initialize()</code></a>:
|
||||||
Initializes the timer facilities. Called early in the intialization sequence (by <code>up_intialize()</code>).
|
Initializes the timer facilities. Called early in the intialization sequence (by <code>up_intialize()</code>).
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -2380,11 +2380,11 @@ config ARCH_SIM
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h5><a name="uptimerinit">4.3.4.4.1 <code>up_timer_initialize()</code></a></h5>
|
<h5><a name="uptimerinit">4.3.4.4.1 <i><arch></i><code>_timer_initialize()</code></a></h5>
|
||||||
<p><b>Function Prototype</b>:</p>
|
<p><b>Function Prototype</b>:</p>
|
||||||
<ul><pre>
|
<ul><pre>
|
||||||
#include <nuttx/arch.h>
|
#include "up_internal.h"
|
||||||
void up_timer_initialize(void);
|
void <i><arch></i>_timer_initialize()(void);
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p><b>Description</b>:</p>
|
<p><b>Description</b>:</p>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -2410,7 +2410,7 @@ void up_timer_initialize(void);
|
|||||||
int up_timer_gettime(FAR struct timespec *ts);
|
int up_timer_gettime(FAR struct timespec *ts);
|
||||||
</pre></ul>
|
</pre></ul>
|
||||||
<p><b>Description</b>:</p>
|
<p><b>Description</b>:</p>
|
||||||
Return the elapsed time since power-up (or, more correctly, since <code>up_timer_initialize()</code> was called). This function is functionally equivalent to <code>clock_gettime()</code> for the clock ID <code>CLOCK_MONOTONIC</code>. This function provides the basis for reporting the current time and also is used to eliminate error build-up from small errors in interval time calculations.
|
Return the elapsed time since power-up (or, more correctly, since <i><arch></i><code>_timer_initialize()</code> was called). This function is functionally equivalent to <code>clock_gettime()</code> for the clock ID <code>CLOCK_MONOTONIC</code>. This function provides the basis for reporting the current time and also is used to eliminate error build-up from small errors in interval time calculations.
|
||||||
<ul>
|
<ul>
|
||||||
</ul>
|
</ul>
|
||||||
<p><b>Input Parameters</b>:</p>
|
<p><b>Input Parameters</b>:</p>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
NuttX TODO List (Last updated January 10, 2017)
|
NuttX TODO List (Last updated February 7, 2017)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||||
@@ -9,10 +9,10 @@ issues related to each board port.
|
|||||||
|
|
||||||
nuttx/:
|
nuttx/:
|
||||||
|
|
||||||
(12) Task/Scheduler (sched/)
|
(10) Task/Scheduler (sched/)
|
||||||
(1) SMP
|
(1) SMP
|
||||||
(1) Memory Management (mm/)
|
(1) Memory Management (mm/)
|
||||||
(1) Power Management (drivers/pm)
|
(0) Power Management (drivers/pm)
|
||||||
(3) Signals (sched/signal, arch/)
|
(3) Signals (sched/signal, arch/)
|
||||||
(2) pthreads (sched/pthread)
|
(2) pthreads (sched/pthread)
|
||||||
(0) Message Queues (sched/mqueue)
|
(0) Message Queues (sched/mqueue)
|
||||||
@@ -165,133 +165,6 @@ o Task/Scheduler (sched/)
|
|||||||
incompatibilities could show up in porting some code).
|
incompatibilities could show up in porting some code).
|
||||||
Priority: Low
|
Priority: Low
|
||||||
|
|
||||||
Title: RELEASE SEMAPHORES HELD BY CANCELED THREADS:
|
|
||||||
Description: Commit: fecb9040d0e54baf14b729e556a832febfe8229e: "In
|
|
||||||
case a thread is doing a blocking operation (e.g. read())
|
|
||||||
on a serial device, while it is being terminated by
|
|
||||||
pthread_cancel(), then uart_close() gets called, but
|
|
||||||
the semaphore (dev->recv.sem in the above example) is
|
|
||||||
still blocked.
|
|
||||||
|
|
||||||
"This means that once the serial device is opened next
|
|
||||||
time, data will arrive on the serial port (and driver
|
|
||||||
interrupts handled as normal), but the received characters
|
|
||||||
never arrive in the reader thread.
|
|
||||||
|
|
||||||
This patch addresses the problem by re-initializing the
|
|
||||||
semaphores on the last uart_close() on the device."
|
|
||||||
|
|
||||||
Yahoo! Groups message 7726: "I think that the system
|
|
||||||
should be required to handle pthread_cancel safely in
|
|
||||||
all cases. In the NuttX model, a task is like a Unix
|
|
||||||
process and a pthread is like a Unix thread. Canceling
|
|
||||||
threads should always be safe (or at least as unsafe) as
|
|
||||||
under Unix because the model is complete for pthreads...
|
|
||||||
|
|
||||||
"So, in my opinion, this is a generic system issue, not
|
|
||||||
specific to the serial driver. I could also implement
|
|
||||||
logic to release all semaphores held by a thread when
|
|
||||||
it exits -- but only if priority inheritance is enabled;
|
|
||||||
because only in that case does the code have any memory
|
|
||||||
of which threads actually hold the semaphore.
|
|
||||||
|
|
||||||
"The patch I just incorporated is also insufficient. It
|
|
||||||
works only if the serial driver is shut down when the
|
|
||||||
thread is canceled. But what if there are other open
|
|
||||||
references to the driver? Then the driver will not be
|
|
||||||
shut down, the semaphores will not be re-initialized, and
|
|
||||||
the semaphore counts will still be off by one.
|
|
||||||
|
|
||||||
"I think that the system needs to automatically release any
|
|
||||||
semaphores held by a thread being killed asynchronously?
|
|
||||||
It seems necessary to me."
|
|
||||||
|
|
||||||
UPDATE; The logic enabled when priority inheritance is
|
|
||||||
enabled for this purpose is insufficient. It provides
|
|
||||||
hooks so that given a semaphore it can traverse all
|
|
||||||
holders. What is needed would be logic so that given
|
|
||||||
a task, you can traverse all semaphores held by the task,
|
|
||||||
releasing each semaphore count held by the exiting task.
|
|
||||||
Nothing like this exists now so that solution is not
|
|
||||||
imminent.
|
|
||||||
|
|
||||||
UPDATE: The basic fix to release the semaphore count if
|
|
||||||
a thread is killed via pthread_cancel() or task_delete()
|
|
||||||
has been implemented (2014-12-13). See the new file:
|
|
||||||
sched/semaphore/sem_recover.c However, the general
|
|
||||||
issue of freeing semaphores when a thread exists still
|
|
||||||
exists.
|
|
||||||
Status: Open
|
|
||||||
Priority: Medium-ish
|
|
||||||
|
|
||||||
Title: ISSUES WITH PRIORITY INHERITANCE WHEN SEMAPHORE/MUTX IS USED AS IPC
|
|
||||||
Description: Semaphores have multiple uses. The typical usage is where
|
|
||||||
the semaphore is used as lock on one or more resources. In
|
|
||||||
this typical case, priority inheritance works perfectly: The
|
|
||||||
holder of a semaphore count must be remembered so that its
|
|
||||||
priority can be boosted if a higher priority task requires a
|
|
||||||
count from the semaphore. It remains the holder until the
|
|
||||||
same task calls sem_post() to release the count on the
|
|
||||||
semaphore.
|
|
||||||
|
|
||||||
But a different usage model for semaphores is for signalling
|
|
||||||
events. In this case, the semaphore count is initialized to
|
|
||||||
zero and the receiving task calls sem_wait() to wait for the
|
|
||||||
next event of interest. When an event of interest is
|
|
||||||
detected by another task (or even an interrupt handler),
|
|
||||||
sem_post() is called which increments the count to 1 and
|
|
||||||
wakes up the receiving task.
|
|
||||||
|
|
||||||
For example, in the following TASK A waits for events and
|
|
||||||
TASK B (or perhaps an interrupt handler) signals task A of
|
|
||||||
the occurence of the events by posting the semaphore:
|
|
||||||
|
|
||||||
---------------------- ---------------
|
|
||||||
TASK A TASK B
|
|
||||||
---------------------- ---------------
|
|
||||||
sem_init(sem, 0, 0);
|
|
||||||
sem_wait(sem);
|
|
||||||
sem_post(sem);
|
|
||||||
Awakens as holder
|
|
||||||
---------------------- ---------------
|
|
||||||
|
|
||||||
These two usage models are really very different and priority
|
|
||||||
inheritance simply does not apply when the semaphore is used for
|
|
||||||
signalling rather than locking. In this signalling case
|
|
||||||
priority inheritance can interfere with the operation of the
|
|
||||||
semaphore. The problem is that when TASK A is awakened it is
|
|
||||||
a holder of the semaphore. Normally, a task is removed from
|
|
||||||
the holder list when it finally releases the semaphore via
|
|
||||||
sem_post().
|
|
||||||
|
|
||||||
However, TASK A never calls sem_post(sem) so it becomes
|
|
||||||
*permanently* a holder of the semaphore and may have its
|
|
||||||
priority boosted at any time when any other task tries to
|
|
||||||
acquire the semaphore.
|
|
||||||
|
|
||||||
The fix is to call sem_setprotocol(SEM_PRIO_NONE) immediately
|
|
||||||
after the sem_init() call so that there will be no priority
|
|
||||||
inheritance operations on this semaphore used for signalling.
|
|
||||||
|
|
||||||
NOTE also that in NuttX, pthread mutexes are build on top of
|
|
||||||
binary semaphores. As a result, the above recommendation also
|
|
||||||
applies when pthread mutexes are used for inter-thread
|
|
||||||
signaling. That is, a mutex that is used for signaling should
|
|
||||||
be initialize like this (simplified, no error checking here):
|
|
||||||
|
|
||||||
pthread_mutexattr_t attr;
|
|
||||||
pthread_mutex_t mutex;
|
|
||||||
|
|
||||||
pthread_mutexattr_init(&attr);
|
|
||||||
pthread_mutexattr_settype(&attr, PTHREAD_PRIO_NONE);
|
|
||||||
pthread_mutex_init(&mutex, &attr);
|
|
||||||
|
|
||||||
Status: Closed. If you have priority inheritance enabled and you use
|
|
||||||
semaphores for signalling events, then you *must* call
|
|
||||||
sem_setprotocol(SEM_PRIO_NONE) immediately after initializing
|
|
||||||
the semaphore.
|
|
||||||
Priority: High.
|
|
||||||
|
|
||||||
Title: SCALABILITY
|
Title: SCALABILITY
|
||||||
Description: Task control information is retained in simple lists. This
|
Description: Task control information is retained in simple lists. This
|
||||||
is completely appropriate for small embedded systems where
|
is completely appropriate for small embedded systems where
|
||||||
@@ -436,37 +309,12 @@ o Memory Management (mm/)
|
|||||||
o Power Management (drivers/pm)
|
o Power Management (drivers/pm)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Title: PM CALLBACKS AREN'T BASED ON DOMAIN
|
|
||||||
Description: Recently support for different power domains was added. Prior
|
|
||||||
to this, only a single domain (the "IDLE" domain was supported).
|
|
||||||
Having multiple power domains extends the basic concept to
|
|
||||||
support power management for different functionality. For
|
|
||||||
example, a UI may be managed separately from, say, some network
|
|
||||||
functionality.
|
|
||||||
|
|
||||||
One thing that was missed when the PM domains was added was
|
|
||||||
support for domain-specific driver callbacks: Currently, all
|
|
||||||
callbacks will be invoked for all PM domain events making it
|
|
||||||
impossible to distinguish the domain in the driver.
|
|
||||||
|
|
||||||
Possibilities:
|
|
||||||
- Add a domain value to the PM registration function. In this
|
|
||||||
case, callbacks would be retained separately for each domain
|
|
||||||
and those callbacks would be invoked only for domain-specific
|
|
||||||
events.
|
|
||||||
- Add a domain value to the PM callback functions. In this case,
|
|
||||||
each driver would receive events from all domains and could
|
|
||||||
respond different (or ignore) events from other domains.
|
|
||||||
Status: Open
|
|
||||||
Priority: Currently low because I know of no use of the multiple PM
|
|
||||||
domains. But, obviously, this would become important if the
|
|
||||||
features were used.
|
|
||||||
o Signals (sched/signal, arch/)
|
o Signals (sched/signal, arch/)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Title: STANDARD SIGNALS
|
Title: STANDARD SIGNALS
|
||||||
Description: 'Standard' signals and signal actions are not supported.
|
Description: 'Standard' signals and signal actions are not supported.
|
||||||
(e.g., SIGINT, SIGSEGV, etc).
|
(e.g., SIGINT, SIGSEGV, etc). Default is only SIG_IGN.
|
||||||
|
|
||||||
Update: SIGCHLD is supported if so configured.
|
Update: SIGCHLD is supported if so configured.
|
||||||
Status: Open. No further changes are planned.
|
Status: Open. No further changes are planned.
|
||||||
@@ -501,7 +349,9 @@ o pthreads (sched/pthreads)
|
|||||||
^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Title: PTHREAD_PRIO_PROTECT
|
Title: PTHREAD_PRIO_PROTECT
|
||||||
Description: Extend pthread_mutexattr_setprotocol() support PTHREAD_PRIO_PROTECT:
|
Description: Extend pthread_mutexattr_setprotocol(). It should support
|
||||||
|
PTHREAD_PRIO_PROTECT (and so should its non-standard counterpart
|
||||||
|
sem_setproto()).
|
||||||
|
|
||||||
"When a thread owns one or more mutexes initialized with the
|
"When a thread owns one or more mutexes initialized with the
|
||||||
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
|
PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/a1x/a1x_timerisr.c
|
* arch/arm/src/a1x/a1x_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -70,19 +70,11 @@
|
|||||||
#define TMR_INTERVAL ((TMR0_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
#define TMR_INTERVAL ((TMR0_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: a1x_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -90,7 +82,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int a1x_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Only a TIMER0 interrupt is expected here */
|
/* Only a TIMER0 interrupt is expected here */
|
||||||
|
|
||||||
@@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -142,7 +138,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)up_timerisr);
|
(void)irq_attach(A1X_IRQ_TIMER0, (xcpt_t)a1x_timerisr);
|
||||||
|
|
||||||
/* Enable interrupts from the TIMER 0 port */
|
/* Enable interrupts from the TIMER 0 port */
|
||||||
|
|
||||||
|
|||||||
@@ -70,19 +70,11 @@
|
|||||||
#define PTV 0x00000003
|
#define PTV 0x00000003
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: c5471_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for
|
* The timer ISR will perform a variety of services for
|
||||||
@@ -90,7 +82,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int c5471_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -99,7 +91,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -107,7 +103,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
|
|
||||||
@@ -122,6 +118,6 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach and enable the timer interrupt */
|
/* Attach and enable the timer interrupt */
|
||||||
|
|
||||||
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
irq_attach(C5471_IRQ_SYSTIMER, (xcpt_t)c5471_timerisr);
|
||||||
up_enable_irq(C5471_IRQ_SYSTIMER);
|
up_enable_irq(C5471_IRQ_SYSTIMER);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ void up_initialize(void)
|
|||||||
|
|
||||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS) && \
|
||||||
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
!defined(CONFIG_SYSTEMTICK_EXTCLK)
|
||||||
up_timer_initialize();
|
arm_timer_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|||||||
@@ -462,8 +462,7 @@ void up_restorefpu(const uint32_t *regs);
|
|||||||
|
|
||||||
/* System timer *************************************************************/
|
/* System timer *************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void);
|
void arm_timer_initialize(void);
|
||||||
int up_timerisr(int irq, uint32_t *regs);
|
|
||||||
|
|
||||||
/* Low level serial output **************************************************/
|
/* Low level serial output **************************************************/
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* arch/arm/src/dm320/dm320_timerisr.c
|
* arch/arm/src/dm320/dm320_timerisr.c
|
||||||
* arch/arm/src/chip/dm320_timerisr.c
|
* arch/arm/src/chip/dm320_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -97,19 +97,11 @@
|
|||||||
#define DM320_TMR0_PRSCL 9 /* (see above) */
|
#define DM320_TMR0_PRSCL 9 /* (see above) */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: dm320_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -117,7 +109,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int dm320_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -126,7 +118,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -134,7 +130,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
up_disable_irq(DM320_IRQ_SYSTIMER);
|
up_disable_irq(DM320_IRQ_SYSTIMER);
|
||||||
|
|
||||||
@@ -151,7 +147,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach and enable the timer interrupt */
|
/* Attach and enable the timer interrupt */
|
||||||
|
|
||||||
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
irq_attach(DM320_IRQ_SYSTIMER, (xcpt_t)dm320_timerisr);
|
||||||
up_enable_irq(DM320_IRQ_SYSTIMER);
|
up_enable_irq(DM320_IRQ_SYSTIMER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/efm32/efm32_timerisr.c
|
* arch/arm/src/efm32/efm32_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
|
* Copyright (C) 2014 Pierre-noel Bouteville . All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Pierre-noel Bouteville <pnb990@gmail.com>
|
* Pierre-noel Bouteville <pnb990@gmail.com>
|
||||||
@@ -74,19 +74,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: efm32_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -94,7 +86,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int efm32_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -103,7 +95,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -111,7 +107,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -129,7 +125,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(EFM32_IRQ_SYSTICK, (xcpt_t)efm32_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* arch/arm/src/imx1/imx_timerisr.c
|
* arch/arm/src/imx1/imx_timerisr.c
|
||||||
* arch/arm/src/chip/imx_timerisr.c
|
* arch/arm/src/chip/imx_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -52,23 +52,11 @@
|
|||||||
#include "up_internal.h"
|
#include "up_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Function: imx_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -76,7 +64,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int imx_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
uint32_t tstat;
|
uint32_t tstat;
|
||||||
int ret = -EIO;
|
int ret = -EIO;
|
||||||
@@ -100,7 +88,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -108,7 +100,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t tctl;
|
uint32_t tctl;
|
||||||
|
|
||||||
@@ -158,7 +150,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach and enable the timer interrupt */
|
/* Attach and enable the timer interrupt */
|
||||||
|
|
||||||
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
irq_attach(IMX_IRQ_SYSTIMER, (xcpt_t)imx_timerisr);
|
||||||
up_enable_irq(IMX_IRQ_SYSTIMER);
|
up_enable_irq(IMX_IRQ_SYSTIMER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/imx6/imx_timerisr.c
|
* arch/arm/src/imx6/imx_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -102,14 +102,14 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_output_compare
|
* Function: imx_output_compare
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Handle one pending output compare interrupt.
|
* Handle one pending output compare interrupt.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void up_output_compare(uint32_t sr, uint32_t of)
|
static void imx_output_compare(uint32_t sr, uint32_t of)
|
||||||
{
|
{
|
||||||
/* Check for a pending output compare interrupt */
|
/* Check for a pending output compare interrupt */
|
||||||
|
|
||||||
@@ -122,11 +122,7 @@ static void up_output_compare(uint32_t sr, uint32_t of)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Function: imx_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -134,7 +130,7 @@ static void up_output_compare(uint32_t sr, uint32_t of)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int imx_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Sample the SR (once) */
|
/* Sample the SR (once) */
|
||||||
|
|
||||||
@@ -146,14 +142,18 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
|
|
||||||
/* Process all pending output compare interrupt */
|
/* Process all pending output compare interrupt */
|
||||||
|
|
||||||
up_output_compare(sr, GPT_INT_OF1);
|
imx_output_compare(sr, GPT_INT_OF1);
|
||||||
up_output_compare(sr, GPT_INT_OF2);
|
imx_output_compare(sr, GPT_INT_OF2);
|
||||||
up_output_compare(sr, GPT_INT_OF3);
|
imx_output_compare(sr, GPT_INT_OF3);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -161,7 +161,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
uint32_t cr;
|
uint32_t cr;
|
||||||
@@ -260,7 +260,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)up_timerisr);
|
(void)irq_attach(IMX_IRQ_GPT, (xcpt_t)imx_timerisr);
|
||||||
|
|
||||||
/* Enable all three GPT output compare interrupts */
|
/* Enable all three GPT output compare interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/kinetis/kinetis_timerisr.c
|
* arch/arm/src/kinetis/kinetis_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -78,19 +78,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: kinetis_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -98,7 +90,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int kinetis_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -143,7 +139,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(KINETIS_IRQ_SYSTICK, (xcpt_t)kinetis_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/kl/kl_timerisr.c
|
* arch/arm/src/kl/kl_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -93,19 +93,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: kl_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -113,7 +105,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int kl_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -122,7 +114,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -130,7 +126,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -147,7 +143,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(KL_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(KL_IRQ_SYSTICK, (xcpt_t)kl_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
||||||
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc11xx/lpc11_timerisr.c
|
* arch/arm/src/lpc11xx/lpc11_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -93,19 +93,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: lpc11_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -113,7 +105,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int lpc11_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -122,7 +114,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -130,7 +126,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -147,7 +143,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(LPC11_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(LPC11_IRQ_SYSTICK, (xcpt_t)lpc11_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
/* Enable SysTick interrupts. "The CLKSOURCE bit in SysTick Control and
|
||||||
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
* Status register selects either the core clock (when CLKSOURCE = 1) or
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc17xx/lpc17_timerisr.c
|
* arch/arm/src/lpc17xx/lpc17_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -79,19 +79,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: lpc17_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -99,7 +91,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int lpc17_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -108,7 +100,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -116,7 +112,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -139,7 +135,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(LPC17_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(LPC17_IRQ_SYSTICK, (xcpt_t)lpc17_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc214x/lpc214x_timerisr.c
|
* arch/arm/src/lpc214x/lpc214x_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -72,19 +72,11 @@
|
|||||||
#define tmr_putreg32(v,o) putreg32((v), LPC214X_TMR0_BASE+(o))
|
#define tmr_putreg32(v,o) putreg32((v), LPC214X_TMR0_BASE+(o))
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: lpc214x_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for
|
* The timer ISR will perform a variety of services for
|
||||||
@@ -93,9 +85,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||||
int up_timerisr(uint32_t *regs)
|
static int lpc214x_timerisr(uint32_t *regs)
|
||||||
#else
|
#else
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int lpc214x_timerisr(int irq, uint32_t *regs)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
@@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint16_t mcr;
|
uint16_t mcr;
|
||||||
|
|
||||||
@@ -158,9 +154,10 @@ void up_timer_initialize(void)
|
|||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||||
up_attach_vector(LPC214X_IRQ_SYSTIMER, LPC214X_SYSTIMER_VEC, (vic_vector_t)up_timerisr);
|
up_attach_vector(LPC214X_IRQ_SYSTIMER, LPC214X_SYSTIMER_VEC,
|
||||||
|
(vic_vector_t)lpc214x_timerisr);
|
||||||
#else
|
#else
|
||||||
(void)irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
(void)irq_attach(LPC214X_IRQ_SYSTIMER, (xcpt_t)lpc214x_timerisr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* And enable the timer interrupt */
|
/* And enable the timer interrupt */
|
||||||
|
|||||||
@@ -81,19 +81,11 @@
|
|||||||
#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV) / TICK_PER_SEC)
|
#define T0_TICKS_COUNT ((CCLK / T0_PCLK_DIV) / TICK_PER_SEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: lpc23xx_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for
|
* The timer ISR will perform a variety of services for
|
||||||
@@ -102,9 +94,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||||
int up_timerisr(uint32_t * regs)
|
static int lpc23xx_timerisr(uint32_t * regs)
|
||||||
#else
|
#else
|
||||||
int up_timerisr(int irq, uint32_t * regs)
|
static int lpc23xx_timerisr(int irq, uint32_t * regs)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
static uint32_t tick;
|
static uint32_t tick;
|
||||||
@@ -138,7 +130,11 @@ int up_timerisr(int irq, uint32_t * regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -146,7 +142,7 @@ int up_timerisr(int irq, uint32_t * regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint16_t mcr;
|
uint16_t mcr;
|
||||||
|
|
||||||
@@ -191,9 +187,9 @@ void up_timer_initialize(void)
|
|||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
#ifdef CONFIG_VECTORED_INTERRUPTS
|
#ifdef CONFIG_VECTORED_INTERRUPTS
|
||||||
up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) up_timerisr);
|
up_attach_vector(IRQ_SYSTIMER, ???, (vic_vector_t) lpc23xx_timerisr);
|
||||||
#else
|
#else
|
||||||
(void)irq_attach(IRQ_SYSTIMER, (xcpt_t) up_timerisr);
|
(void)irq_attach(IRQ_SYSTIMER, (xcpt_t)lpc23xx_timerisr);
|
||||||
#ifdef CONFIG_ARCH_IRQPRIO
|
#ifdef CONFIG_ARCH_IRQPRIO
|
||||||
up_prioritize_irq(IRQ_SYSTIMER, PRIORITY_HIGHEST);
|
up_prioritize_irq(IRQ_SYSTIMER, PRIORITY_HIGHEST);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc31xx/lpc31_timerisr.c
|
* arch/arm/src/lpc31xx/lpc31_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -54,23 +54,11 @@
|
|||||||
#include "lpc31.h"
|
#include "lpc31.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Function: lpc31_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -78,7 +66,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int lpc31_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Clear the lattched timer interrupt (Writing any value to the CLEAR register
|
/* Clear the lattched timer interrupt (Writing any value to the CLEAR register
|
||||||
* clears the interrupt generated by the counter timer
|
* clears the interrupt generated by the counter timer
|
||||||
@@ -93,7 +81,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -101,7 +93,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
uint64_t load;
|
uint64_t load;
|
||||||
@@ -143,7 +135,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)up_timerisr);
|
(void)irq_attach(LPC31_IRQ_TMR0, (xcpt_t)lpc31_timerisr);
|
||||||
|
|
||||||
/* Clear any latched timer interrupt (Writing any value to the CLEAR register
|
/* Clear any latched timer interrupt (Writing any value to the CLEAR register
|
||||||
* clears the latched interrupt generated by the counter timer)
|
* clears the latched interrupt generated by the counter timer)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ static inline void lpc43_RIT_timer_stop(void)
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t ticks_per_int;
|
uint32_t ticks_per_int;
|
||||||
uint32_t mask_bits = 0;
|
uint32_t mask_bits = 0;
|
||||||
|
|||||||
@@ -58,8 +58,6 @@
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void);
|
|
||||||
int up_timer_gettime(FAR struct timespec *ts);
|
|
||||||
int up_alarm_cancel(FAR struct timespec *ts);
|
int up_alarm_cancel(FAR struct timespec *ts);
|
||||||
int up_alarm_start(FAR const struct timespec *ts);
|
int up_alarm_start(FAR const struct timespec *ts);
|
||||||
int up_timer_cancel(FAR struct timespec *ts);
|
int up_timer_cancel(FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -595,7 +595,7 @@ static int lpc43_tl_isr(int irq, FAR void *context)
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc43xx/lpc43_timerisr.c
|
* arch/arm/src/lpc43xx/lpc43_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -78,19 +78,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: lpc43_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -98,7 +90,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int lpc43_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -107,7 +99,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -115,7 +111,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -138,7 +134,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(LPC43_IRQ_SYSTICK, (xcpt_t)lpc43_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* arch/arm/src/moxart/moxart_timer.c
|
* arch/arm/src/moxart/moxart_timer.c
|
||||||
* MoxaRT internal Timer Driver
|
* MoxaRT internal Timer Driver
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
* Author: Anton D. Kachalov <mouse@mayc.ru>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -90,7 +90,7 @@ static uint32_t cmp = BOARD_32KOSC_FREQUENCY / 100;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timerisr
|
* Function: moxart_timerisr
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -98,7 +98,7 @@ static uint32_t cmp = BOARD_32KOSC_FREQUENCY / 100;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int moxart_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
uint32_t state;
|
uint32_t state;
|
||||||
|
|
||||||
@@ -117,7 +117,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Setup MoxaRT timer 0 to cause system ticks.
|
* Setup MoxaRT timer 0 to cause system ticks.
|
||||||
@@ -127,7 +131,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
|
|
||||||
@@ -144,7 +148,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach and enable the timer interrupt */
|
/* Attach and enable the timer interrupt */
|
||||||
|
|
||||||
irq_attach(IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
irq_attach(IRQ_SYSTIMER, (xcpt_t)moxart_timerisr);
|
||||||
up_enable_irq(IRQ_SYSTIMER);
|
up_enable_irq(IRQ_SYSTIMER);
|
||||||
ftintc010_set_trig_mode(IRQ_SYSTIMER, 1);
|
ftintc010_set_trig_mode(IRQ_SYSTIMER, 1);
|
||||||
ftintc010_set_trig_level(IRQ_SYSTIMER, 0);
|
ftintc010_set_trig_level(IRQ_SYSTIMER, 0);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/nuc1xx/nuc_timerisr.c
|
* arch/arm/src/nuc1xx/nuc_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -100,11 +100,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Function Prototypes
|
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -152,11 +148,7 @@ static inline void nuc_lock(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Function: nuc_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -164,7 +156,7 @@ static inline void nuc_lock(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int nuc_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -173,7 +165,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -181,7 +177,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -230,7 +226,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(NUC_IRQ_SYSTICK, (xcpt_t)nuc_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts. We need to select the core clock here if
|
/* Enable SysTick interrupts. We need to select the core clock here if
|
||||||
* we are not using one of the alternative clock sources above.
|
* we are not using one of the alternative clock sources above.
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
* is suppressed and the platform specific code is expected to provide the
|
* is suppressed and the platform specific code is expected to provide the
|
||||||
* following custom functions.
|
* following custom functions.
|
||||||
*
|
*
|
||||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||||
* early in the initialization sequence (by up_intialize()).
|
* early in the initialization sequence (by up_intialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
@@ -206,7 +206,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initializes all platform-specific timer facilities. This function is
|
* Initializes all platform-specific timer facilities. This function is
|
||||||
@@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||||
uint64_t max_delay;
|
uint64_t max_delay;
|
||||||
@@ -292,7 +292,7 @@ void up_timer_initialize(void)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the elapsed time since power-up (or, more correctly, since
|
* Return the elapsed time since power-up (or, more correctly, since
|
||||||
* up_timer_initialize() was called). This function is functionally
|
* arm_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/sam34/sam_timerisr.c
|
* arch/arm/src/sam34/sam_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2013-2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -100,19 +100,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: sam_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -120,7 +112,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int sam_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -129,7 +121,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -137,7 +133,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -167,7 +163,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
* is suppressed and the platform specific code is expected to provide the
|
* is suppressed and the platform specific code is expected to provide the
|
||||||
* following custom functions.
|
* following custom functions.
|
||||||
*
|
*
|
||||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||||
* early in the initialization sequence (by up_intialize()).
|
* early in the initialization sequence (by up_intialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
@@ -218,7 +218,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initializes all platform-specific timer facilities. This function is
|
* Initializes all platform-specific timer facilities. This function is
|
||||||
@@ -242,7 +242,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||||
uint64_t max_delay;
|
uint64_t max_delay;
|
||||||
@@ -304,7 +304,7 @@ void up_timer_initialize(void)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the elapsed time since power-up (or, more correctly, since
|
* Return the elapsed time since power-up (or, more correctly, since
|
||||||
* up_timer_initialize() was called). This function is functionally
|
* arm_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/sama5/sam_timerisr.c
|
* arch/arm/src/sama5/sam_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -76,19 +76,11 @@
|
|||||||
#define PIT_PIV ((PIT_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
#define PIT_PIV ((PIT_CLOCK + (CLK_TCK >> 1)) / CLK_TCK)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: sam_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -96,7 +88,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int sam_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* "When CPIV and PICNT values are obtained by reading the Periodic
|
/* "When CPIV and PICNT values are obtained by reading the Periodic
|
||||||
* Interval Value Register (PIT_PIVR), the overflow counter (PICNT) is
|
* Interval Value Register (PIT_PIVR), the overflow counter (PICNT) is
|
||||||
@@ -118,7 +110,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -126,7 +122,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -140,7 +136,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(SAM_IRQ_PIT, (xcpt_t)up_timerisr);
|
(void)irq_attach(SAM_IRQ_PIT, (xcpt_t)sam_timerisr);
|
||||||
|
|
||||||
/* Set the PIT overflow value (PIV), enable the PIT, and enable
|
/* Set the PIT overflow value (PIV), enable the PIT, and enable
|
||||||
* interrupts from the PIT.
|
* interrupts from the PIT.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/samdl/sam_timerisr.c
|
* arch/arm/src/samdl/sam_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -83,19 +83,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: sam_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -103,7 +95,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int sam_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -112,7 +104,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -120,7 +116,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -137,7 +133,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
* is suppressed and the platform specific code is expected to provide the
|
* is suppressed and the platform specific code is expected to provide the
|
||||||
* following custom functions.
|
* following custom functions.
|
||||||
*
|
*
|
||||||
* void up_timer_initialize(void): Initializes the timer facilities. Called
|
* void arm_timer_initialize(void): Initializes the timer facilities. Called
|
||||||
* early in the initialization sequence (by up_intialize()).
|
* early in the initialization sequence (by up_intialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
@@ -230,7 +230,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initializes all platform-specific timer facilities. This function is
|
* Initializes all platform-specific timer facilities. This function is
|
||||||
@@ -254,7 +254,7 @@ static void sam_oneshot_handler(void *arg)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ void up_timer_initialize(void)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the elapsed time since power-up (or, more correctly, since
|
* Return the elapsed time since power-up (or, more correctly, since
|
||||||
* up_timer_initialize() was called). This function is functionally
|
* arm_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/samv7/sam_timerisr.c
|
* arch/arm/src/samv7/sam_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -86,19 +86,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: sam_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -106,7 +98,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int sam_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -134,7 +130,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(SAM_IRQ_SYSTICK, (xcpt_t)sam_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts (no divide-by-8) */
|
/* Enable SysTick interrupts (no divide-by-8) */
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
* is suppressed and the platform specific code is expected to provide the
|
* is suppressed and the platform specific code is expected to provide the
|
||||||
* following custom functions.
|
* following custom functions.
|
||||||
*
|
*
|
||||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||||
* Called early in the initialization sequence (by up_intialize()).
|
* Called early in the initialization sequence (by up_intialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
@@ -162,7 +162,7 @@ static void stm32_oneshot_handler(void *arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initializes all platform-specific timer facilities. This function is
|
* Initializes all platform-specific timer facilities. This function is
|
||||||
@@ -186,7 +186,7 @@ static void stm32_oneshot_handler(void *arg)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||||
uint64_t max_delay;
|
uint64_t max_delay;
|
||||||
@@ -244,7 +244,7 @@ void up_timer_initialize(void)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the elapsed time since power-up (or, more correctly, since
|
* Return the elapsed time since power-up (or, more correctly, since
|
||||||
* up_timer_initialize() was called). This function is functionally
|
* arm_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/stm32/stm32_timerisr.c
|
* arch/arm/src/stm32/stm32_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -86,19 +86,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: stm32_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -106,7 +98,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int stm32_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -152,7 +148,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/stm32f7/stm32_timerisr.c
|
* arch/arm/src/stm32f7/stm32_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -92,19 +92,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: stm32_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -112,7 +104,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int stm32_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -121,7 +113,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -129,7 +125,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -140,7 +136,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(STM32_IRQ_SYSTICK, (xcpt_t)stm32_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts:
|
/* Enable SysTick interrupts:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
* is suppressed and the platform specific code is expected to provide the
|
* is suppressed and the platform specific code is expected to provide the
|
||||||
* following custom functions.
|
* following custom functions.
|
||||||
*
|
*
|
||||||
* void up_timer_initialize(void): Initializes the timer facilities.
|
* void arm_timer_initialize(void): Initializes the timer facilities.
|
||||||
* Called early in the initialization sequence (by up_intialize()).
|
* Called early in the initialization sequence (by up_intialize()).
|
||||||
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
* int up_timer_gettime(FAR struct timespec *ts): Returns the current
|
||||||
* time from the platform specific time source.
|
* time from the platform specific time source.
|
||||||
@@ -163,7 +163,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initializes all platform-specific timer facilities. This function is
|
* Initializes all platform-specific timer facilities. This function is
|
||||||
@@ -187,7 +187,7 @@ static void stm32l4_oneshot_handler(FAR void *arg)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
#ifdef CONFIG_SCHED_TICKLESS_LIMIT_MAX_SLEEP
|
||||||
uint64_t max_delay;
|
uint64_t max_delay;
|
||||||
@@ -245,7 +245,7 @@ void up_timer_initialize(void)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the elapsed time since power-up (or, more correctly, since
|
* Return the elapsed time since power-up (or, more correctly, since
|
||||||
* up_timer_initialize() was called). This function is functionally
|
* arm_timer_initialize() was called). This function is functionally
|
||||||
* equivalent to:
|
* equivalent to:
|
||||||
*
|
*
|
||||||
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
* int clock_gettime(clockid_t clockid, FAR struct timespec *ts);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/stm32l4/stm32l4_timerisr.c
|
* arch/arm/src/stm32l4/stm32l4_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -86,19 +86,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: stm32l4_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -106,7 +98,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int stm32l4_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -115,7 +107,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -123,7 +119,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -152,7 +148,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(STM32L4_IRQ_SYSTICK, (xcpt_t)stm32l4_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/str71x/str71x_timerisr.c
|
* arch/arm/src/str71x/str71x_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -114,19 +114,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: str71x_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -134,7 +126,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int str71x_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
uint16_t ocar;
|
uint16_t ocar;
|
||||||
|
|
||||||
@@ -158,7 +150,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -166,7 +162,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
@@ -208,7 +204,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)up_timerisr);
|
(void)irq_attach(STR71X_IRQ_SYSTIMER, (xcpt_t)str71x_timerisr);
|
||||||
|
|
||||||
/* And enable the timer interrupt */
|
/* And enable the timer interrupt */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/tiva/tiva_timerisr.c
|
* arch/arm/src/tiva/tiva_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -76,19 +76,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: tiva_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -96,7 +88,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int tiva_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -105,7 +97,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -113,7 +109,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -130,7 +126,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)up_timerisr);
|
(void)irq_attach(TIVA_IRQ_SYSTICK, (xcpt_t)tiva_timerisr);
|
||||||
|
|
||||||
/* Enable SysTick interrupts */
|
/* Enable SysTick interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/tms570/tms570_timerisr.c
|
* arch/arm/src/tms570/tms570_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -118,11 +118,11 @@
|
|||||||
#define RTI_CMP0 ((CONFIG_USEC_PER_TICK * (RTI_FRC0CLK / 100000) + 50) / 100)
|
#define RTI_CMP0 ((CONFIG_USEC_PER_TICK * (RTI_FRC0CLK / 100000) + 50) / 100)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timerisr
|
* Name: tms570_timerisr
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int tms570_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Cleear the RTI Compare 0 interrupts */
|
/* Cleear the RTI Compare 0 interrupts */
|
||||||
|
|
||||||
@@ -143,7 +143,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: arm_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -151,7 +155,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void arm_timer_initialize(void)
|
||||||
{
|
{
|
||||||
/* Disable all RTI interrupts */
|
/* Disable all RTI interrupts */
|
||||||
|
|
||||||
@@ -190,7 +194,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the interrupt handler to the RTI Compare 0 interrupt */
|
/* Attach the interrupt handler to the RTI Compare 0 interrupt */
|
||||||
|
|
||||||
DEBUGVERIFY(irq_attach(TMS570_REQ_RTICMP0, (xcpt_t)up_timerisr));
|
DEBUGVERIFY(irq_attach(TMS570_REQ_RTICMP0, (xcpt_t)tms570_timerisr));
|
||||||
|
|
||||||
/* Enable RTI compare 0 interrupts at the VIM */
|
/* Enable RTI compare 0 interrupts at the VIM */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/at32uc3/at32uc3_timerisr.c
|
* arch/avr/src/at32uc3/at32uc3_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2010, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -130,10 +130,6 @@
|
|||||||
# define AV32_TOP (144-1)
|
# define AV32_TOP (144-1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Types
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -153,11 +149,7 @@ static void rtc_waitnotbusy(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Function: at32uc3_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -165,7 +157,7 @@ static void rtc_waitnotbusy(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int at32uc3_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Clear the pending timer interrupt */
|
/* Clear the pending timer interrupt */
|
||||||
|
|
||||||
@@ -178,7 +170,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: avr_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -187,7 +183,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void avr_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
@@ -223,7 +219,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(AVR32_IRQ_RTC, (xcpt_t)up_timerisr);
|
(void)irq_attach(AVR32_IRQ_RTC, (xcpt_t)at32uc3_timerisr);
|
||||||
|
|
||||||
/* Enable RTC interrupts */
|
/* Enable RTC interrupts */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/at90usb/at90usb_timerisr.c
|
* arch/avr/src/at90usb/at90usb_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -101,20 +101,12 @@
|
|||||||
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Types
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Function: at90usb_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -122,7 +114,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int at90usb_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -131,7 +123,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: avr_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -140,7 +136,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void avr_timer_initialize(void)
|
||||||
{
|
{
|
||||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||||
*
|
*
|
||||||
@@ -172,7 +168,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)up_timerisr);
|
(void)irq_attach(AT90USB_IRQ_T1COMPA, (xcpt_t)at90usb_timerisr);
|
||||||
|
|
||||||
/* Enable the interrupt on compare match A */
|
/* Enable the interrupt on compare match A */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/avr/src/atmega/atmega_timerisr.c
|
* arch/avr/src/atmega/atmega_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -101,20 +101,12 @@
|
|||||||
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
* MATCH1024 (( 7804 + 50) / 100) = 78 FREQ=100.1Hz
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Types
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Function: atmega_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -122,7 +114,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int atmega_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
@@ -131,7 +123,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: avr_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the timer
|
* This function is called during start-up to initialize the timer
|
||||||
@@ -140,7 +136,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void avr_timer_initialize(void)
|
||||||
{
|
{
|
||||||
/* Setup timer 1 compare match A to generate a tick interrupt.
|
/* Setup timer 1 compare match A to generate a tick interrupt.
|
||||||
*
|
*
|
||||||
@@ -173,9 +169,9 @@ void up_timer_initialize(void)
|
|||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
#if defined(ATMEGA_IRQ_T1COMPA)
|
#if defined(ATMEGA_IRQ_T1COMPA)
|
||||||
(void)irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)up_timerisr);
|
(void)irq_attach(ATMEGA_IRQ_T1COMPA, (xcpt_t)atmega_timerisr);
|
||||||
#elif defined(ATMEGA_IRQ_TIM1_COMPA)
|
#elif defined(ATMEGA_IRQ_TIM1_COMPA)
|
||||||
(void)irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)up_timerisr);
|
(void)irq_attach(ATMEGA_IRQ_TIM1_COMPA, (xcpt_t)atmega_timerisr);
|
||||||
#else
|
#else
|
||||||
# error "Unable to find IRQ for timer"
|
# error "Unable to find IRQ for timer"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ void up_initialize(void)
|
|||||||
/* Initialize the system timer interrupt */
|
/* Initialize the system timer interrupt */
|
||||||
|
|
||||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||||
up_timer_initialize();
|
avr_timer_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ void up_irqinitialize(void);
|
|||||||
void weak_function up_dmainitialize(void);
|
void weak_function up_dmainitialize(void);
|
||||||
#endif
|
#endif
|
||||||
void up_sigdeliver(void);
|
void up_sigdeliver(void);
|
||||||
int up_timerisr(int irq, uint32_t *regs);
|
|
||||||
void up_lowputc(char ch);
|
void up_lowputc(char ch);
|
||||||
void up_puts(const char *str);
|
void up_puts(const char *str);
|
||||||
void up_lowputs(const char *str);
|
void up_lowputs(const char *str);
|
||||||
@@ -185,7 +184,7 @@ void lowconsole_init(void);
|
|||||||
|
|
||||||
/* Defined in chip/xxx_timerisr.c */
|
/* Defined in chip/xxx_timerisr.c */
|
||||||
|
|
||||||
void up_timer_initialize(void);
|
void avr_timer_initialize(void);
|
||||||
|
|
||||||
/* Defined in chip/xxx_ethernet.c */
|
/* Defined in chip/xxx_ethernet.c */
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void up_initialize(void)
|
|||||||
/* Initialize the system timer interrupt */
|
/* Initialize the system timer interrupt */
|
||||||
|
|
||||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||||
up_timer_initialize();
|
hc_timer_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|||||||
@@ -173,8 +173,7 @@ void up_sigdeliver(void);
|
|||||||
|
|
||||||
/* System timer initialization */
|
/* System timer initialization */
|
||||||
|
|
||||||
void up_timer_initialize(void);
|
void hc_timer_initialize(void);
|
||||||
int up_timerisr(int irq, uint32_t *regs);
|
|
||||||
|
|
||||||
/* Debug output */
|
/* Debug output */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/hc/src/m9s12/m9s12_timerisr.c
|
* arch/hc/src/m9s12/m9s12_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -119,19 +119,11 @@
|
|||||||
#define MODCNT_VALUE ((((uint32_t)HCS12_OSCCLK + (MODCNT_DENOM/2))/ MODCNT_DENOM) - 1)
|
#define MODCNT_VALUE ((((uint32_t)HCS12_OSCCLK + (MODCNT_DENOM/2))/ MODCNT_DENOM) - 1)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: m9s12_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -139,7 +131,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int m9s12_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Clear real time interrupt flag */
|
/* Clear real time interrupt flag */
|
||||||
|
|
||||||
@@ -152,7 +144,11 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: hc_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize the system timer
|
* This function is called during start-up to initialize the system timer
|
||||||
@@ -160,7 +156,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void hc_timer_initialize(void)
|
||||||
{
|
{
|
||||||
uint32_t tmp;
|
uint32_t tmp;
|
||||||
uint8_t regval;
|
uint8_t regval;
|
||||||
@@ -175,7 +171,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(HCS12_IRQ_VRTI, (xcpt_t)up_timerisr);
|
(void)irq_attach(HCS12_IRQ_VRTI, (xcpt_t)m9s12_timerisr);
|
||||||
|
|
||||||
/* Enable RTI interrupt by setting the RTIE bit */
|
/* Enable RTI interrupt by setting the RTIE bit */
|
||||||
|
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ void up_initialize(void)
|
|||||||
/* Initialize the system timer interrupt */
|
/* Initialize the system timer interrupt */
|
||||||
|
|
||||||
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && !defined(CONFIG_SUPPRESS_TIMER_INTS)
|
||||||
up_timer_initialize();
|
mips_timer_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register devices */
|
/* Register devices */
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ void up_serialinit(void);
|
|||||||
|
|
||||||
/* System timer */
|
/* System timer */
|
||||||
|
|
||||||
void up_timer_initialize(void);
|
void mips_timer_initialize(void);
|
||||||
|
|
||||||
/* Network */
|
/* Network */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/mips/src/pic32mx/pic32mx_timerisr.c
|
* arch/mips/src/pic32mx/pic32mx_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -125,19 +125,11 @@
|
|||||||
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: pc32mx_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -145,20 +137,24 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int pc32mx_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Clear the pending timer interrupt */
|
/* Clear the pending timer interrupt */
|
||||||
|
|
||||||
putreg32(INT_T1, PIC32MX_INT_IFS0CLR);
|
putreg32(INT_T1, PIC32MX_INT_IFS0CLR);
|
||||||
|
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
sched_process_timer();
|
sched_process_timer();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: mips_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -166,7 +162,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void mips_timer_initialize(void)
|
||||||
{
|
{
|
||||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||||
@@ -187,7 +183,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(PIC32MX_IRQ_T1, (xcpt_t)up_timerisr);
|
(void)irq_attach(PIC32MX_IRQ_T1, (xcpt_t)pc32mx_timerisr);
|
||||||
|
|
||||||
/* And enable the timer interrupt */
|
/* And enable the timer interrupt */
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/mips/src/pic32mz/pic32mz_timerisr.c
|
* arch/mips/src/pic32mz/pic32mz_timerisr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -124,19 +124,11 @@
|
|||||||
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
#define TIMER1_MATCH (TIMER1_SRC_FREQ / TIMER1_PRESCALE / CLOCKS_PER_SEC)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Function: pc32mz_timerisr
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: up_timerisr
|
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The timer ISR will perform a variety of services for various portions
|
* The timer ISR will perform a variety of services for various portions
|
||||||
@@ -144,20 +136,24 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int up_timerisr(int irq, uint32_t *regs)
|
static int pc32mz_timerisr(int irq, uint32_t *regs)
|
||||||
{
|
{
|
||||||
/* Clear the pending timer interrupt */
|
/* Clear the pending timer interrupt */
|
||||||
|
|
||||||
up_clrpend_irq(PIC32MZ_IRQ_T1);
|
up_clrpend_irq(PIC32MZ_IRQ_T1);
|
||||||
|
|
||||||
/* Process timer interrupt */
|
/* Process timer interrupt */
|
||||||
|
|
||||||
sched_process_timer();
|
sched_process_timer();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: up_timer_initialize
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Function: mips_timer_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called during start-up to initialize
|
* This function is called during start-up to initialize
|
||||||
@@ -165,7 +161,7 @@ int up_timerisr(int irq, uint32_t *regs)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void up_timer_initialize(void)
|
void mips_timer_initialize(void)
|
||||||
{
|
{
|
||||||
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
/* Configure and enable TIMER1. Used the computed TCKPS divider and timer
|
||||||
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
* match value. The source will be either the internal PBCLOCK (TCS=0) or
|
||||||
@@ -183,7 +179,7 @@ void up_timer_initialize(void)
|
|||||||
|
|
||||||
/* Attach the timer interrupt vector */
|
/* Attach the timer interrupt vector */
|
||||||
|
|
||||||
(void)irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)up_timerisr);
|
(void)irq_attach(PIC32MZ_IRQ_T1, (xcpt_t)pc32mz_timerisr);
|
||||||
|
|
||||||
/* And enable the timer interrupt */
|
/* And enable the timer interrupt */
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user