forked from Imagelibrary/rtems
2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1748/bsps * clock/ckinit.c: When the clock tick generates an interrupt WHILE we have interrupts disabled doing a get TOD or uptime, the get nanoseconds handler was returning a bogusly large number.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
PR 1748/bsps
|
||||
* clock/ckinit.c: When the clock tick generates an interrupt WHILE we
|
||||
have interrupts disabled doing a get TOD or uptime, the get
|
||||
nanoseconds handler was returning a bogusly large number.
|
||||
|
||||
2011-03-03 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
PR 1750/bsps
|
||||
|
||||
@@ -49,11 +49,17 @@ extern int CLOCK_SPEED;
|
||||
uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t usecs;
|
||||
|
||||
clicks = ERC32_MEC.Real_Time_Clock_Counter;
|
||||
|
||||
return (uint32_t)
|
||||
(rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
if ( ERC32_Is_interrupt_pending( ERC32_INTERRUPT_REAL_TIME_CLOCK ) ) {
|
||||
clicks = ERC32_MEC.Real_Time_Clock_Counter;
|
||||
usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
} else {
|
||||
usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
}
|
||||
return usecs * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick \
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
PR 1748/bsps
|
||||
* clock/ckinit.c: When the clock tick generates an interrupt WHILE we
|
||||
have interrupts disabled doing a get TOD or uptime, the get
|
||||
nanoseconds handler was returning a bogusly large number.
|
||||
|
||||
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* cchip/cchip.c, include/tm27.h, startup/spurious.c:
|
||||
|
||||
@@ -62,12 +62,15 @@ extern int CLOCK_SPEED;
|
||||
uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t usecs;
|
||||
|
||||
clicks = LEON_REG.Timer_Counter_1;
|
||||
|
||||
/* Down counter */
|
||||
return (uint32_t)
|
||||
(rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
if ( LEON_Is_interrupt_pending( LEON_INTERRUPT_TIMER1 ) ) {
|
||||
clicks = LEON_REG.Timer_Counter_1;
|
||||
usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
} else {
|
||||
usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
}
|
||||
return usecs * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
Reference in New Issue
Block a user