Changeset 8d64f08e in rtems


Ignore:
Timestamp:
May 27, 2009, 2:34:24 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
b11e05f
Parents:
22ed4172
Message:

2009-05-27 Fernando Nicodemos <fgnicodemos@…>

  • at91rm9200/clock/clock.c: Add support for nanoseconds since last tick. The resolution is not that high but better than nothing.
Location:
c/src/lib/libcpu/arm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/ChangeLog

    r22ed4172 r8d64f08e  
     12009-05-27      Fernando Nicodemos <fgnicodemos@terra.com.br>
     2
     3        * at91rm9200/clock/clock.c: Add support for nanoseconds since last
     4        tick. The resolution is not that high but better than nothing.
     5
    162008-12-11      Ralf Corsepius <ralf.corsepius@rtems.org>
    27
  • c/src/lib/libcpu/arm/at91rm9200/clock/clock.c

    r22ed4172 r8d64f08e  
    7777  BSP_install_rtems_irq_handler(&clock_isr_data)
    7878
     79uint16_t st_pimr_value;
    7980void Clock_driver_support_initialize_hardware(void)
    8081{
     
    8485  /* the system timer is driven from SLCK */
    8586  slck = at91rm9200_get_slck();
    86   st_pimr_reload =
     87  st_pimr_value =
    8788    (((rtems_configuration_get_microseconds_per_tick() * slck) + (1000000/2))/ 1000000);
     89  st_pimr_reload = st_pimr_value;
    8890
    8991  /* read the status to clear the int */
     
    9799}
    98100
     101uint32_t bsp_clock_nanoseconds_since_last_tick(void)
     102{
     103  uint16_t slck_counts;
     104
     105  slck_counts = st_pimr_value - st_pimr_reload;
     106  return (rtems_configuration_get_microseconds_per_tick() * slck_counts * 1000)
     107     / st_pimr_value;
     108}
     109
     110#define Clock_driver_nanoseconds_since_last_tick \
     111  bsp_clock_nanoseconds_since_last_tick
    99112
    100113#define CLOCK_VECTOR 0
Note: See TracChangeset for help on using the changeset viewer.