Ignore:
Timestamp:
07/18/95 21:19:53 (28 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3b170f5
Parents:
3ea5288
Message:

committing for rtems-3.2.01 snapshot

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/go32/timer/timer.c

    r3ea5288 r4ca27cf  
    2323
    2424#include <rtems.h>
    25 #include <cpu.h>
    2625#include <bsp.h>
    2726
     
    4847    static int First = 1;
    4948    if ( First )  {
    50         /* install ISR */
    51         set_vector( timerisr, 0x8, 0 );
     49        /* install ISR */
     50        set_vector( timerisr, 0x8, 0 );
    5251
    53         /* Wait for ISR to be called at least once */
    54         Ttimer_val = 0;
    55         while ( Ttimer_val == 0 )
    56             continue;
     52        /* Wait for ISR to be called at least once */
     53        Ttimer_val = 0;
     54        while ( Ttimer_val == 0 )
     55            continue;
    5756
    58         /* load timer for 250 microsecond period */
    59         outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
    60         outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 0 & 0xff);
    61         outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 8 & 0xff);
     57        /* load timer for 250 microsecond period */
     58        outport_byte( TIMER_MODE, TIMER_SEL0|TIMER_16BIT|TIMER_RATEGEN );
     59        outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 0 & 0xff);
     60        outport_byte( TIMER_CNTR0, US_TO_TICK(250) >> 8 & 0xff);
    6261
    63         First = 0;
     62        First = 0;
    6463    }
    6564    Ttimer_val = 0;                           /* clear timer ISR count */
     
    6766}
    6867
    69 #define AVG_OVERHEAD       0  /* 0.1 microseconds to start/stop timer. */
    70 #define LEAST_VALID        1  /* Don't trust a value lower than this */
     68#define AVG_OVERHEAD       0  /* 0.1 microseconds to start/stop timer. */
     69#define LEAST_VALID        1  /* Don't trust a value lower than this */
    7170
    7271
     
    8786
    8887    if ( Timer_driver_Find_average_overhead == 1 )
    89         return total;
     88        return total;
    9089    else if ( total < LEAST_VALID )
    91         return 0;               /* below timer resolution */
     90        return 0;               /* below timer resolution */
    9291    else
    93         return total - AVG_OVERHEAD;
     92        return total - AVG_OVERHEAD;
    9493}
    9594
Note: See TracChangeset for help on using the changeset viewer.