Ignore:
Timestamp:
May 19, 2011, 12:09:04 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
76134c5
Parents:
00d95ce0
Message:

2011-05-19 Sebastian Huber <sebastian.huber@…>

  • shared/lpc/include/lpc-emc.h, shared/lpc/include/lpc-lcd.h: New files.
  • shared/lpc/include/lpc-dma.h: API changes.
  • shared/lpc/clock/lpc-clock-config.c: Fixed nano seconds extension.
  • shared/lpc/network/lpc-ethernet.c: Format. Multicast hash filter support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/lpc/clock/lpc-clock-config.c

    r00d95ce0 rf6083f0  
    88
    99/*
    10  * Copyright (c) 2009
    11  * embedded brains GmbH
    12  * Obere Lagerstr. 30
    13  * D-82178 Puchheim
    14  * Germany
    15  * <rtems@embedded-brains.de>
     10 * Copyright (c) 2009-2011 embedded brains GmbH.  All rights reserved.
     11 *
     12 *  embedded brains GmbH
     13 *  Obere Lagerstr. 30
     14 *  82178 Puchheim
     15 *  Germany
     16 *  <rtems@embedded-brains.de>
    1617 *
    1718 * The license and distribution terms for this file may be
     
    2627rtems_isr Clock_isr(rtems_vector_number vector);
    2728
    28 static volatile lpc_timer *const lpc_clock = 
     29static volatile lpc_timer *const lpc_clock =
    2930  (volatile lpc_timer *) LPC_CLOCK_TIMER_BASE;
    3031
     
    103104static uint32_t lpc_clock_nanoseconds_since_last_tick(void)
    104105{
    105   uint64_t clock = LPC_CLOCK_REFERENCE;
    106   uint64_t clicks = lpc_clock->tc;
    107   uint64_t ns = (clicks * 1000000000) / clock;
     106  uint64_t k = (1000000000ULL << 32) / LPC_CLOCK_REFERENCE;
     107  uint64_t c = lpc_clock->tc;
    108108
    109   return (uint32_t) ns;
     109  if ((lpc_clock->ir & LPC_TIMER_IR_MR0) != 0) {
     110    c = lpc_clock->tc + lpc_clock->mr0;
     111  }
     112
     113  return (uint32_t) ((c * k) >> 32);
    110114}
    111115
Note: See TracChangeset for help on using the changeset viewer.