forked from Imagelibrary/rtems
LEON3: clock timer indexing should be consequent
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
This commit is contained in:
committed by
Gedare Bloom
parent
0729e2a7af
commit
4fa6be9779
@@ -54,7 +54,7 @@ static int clkirq;
|
|||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
#else
|
#else
|
||||||
#define Adjust_clkirq_for_node()
|
#define Adjust_clkirq_for_node() do { clkirq += LEON3_CLOCK_INDEX; } while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define Clock_driver_support_find_timer() \
|
#define Clock_driver_support_find_timer() \
|
||||||
@@ -102,10 +102,10 @@ uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
|||||||
if ( !LEON3_Timer_Regs )
|
if ( !LEON3_Timer_Regs )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
clicks = LEON3_Timer_Regs->timer[0].value;
|
clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
|
||||||
|
|
||||||
if ( LEON_Is_interrupt_pending( clkirq ) ) {
|
if ( LEON_Is_interrupt_pending( clkirq ) ) {
|
||||||
clicks = LEON3_Timer_Regs->timer[0].value;
|
clicks = LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].value;
|
||||||
usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
|
usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||||
} else {
|
} else {
|
||||||
usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
|
usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||||
|
|||||||
Reference in New Issue
Block a user