Changeset 4ca27cf in rtems for c/src/lib/libbsp/i386/go32/timer/timer.c
- Timestamp:
- 07/18/95 21:19:53 (28 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 3b170f5
- Parents:
- 3ea5288
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/go32/timer/timer.c
r3ea5288 r4ca27cf 23 23 24 24 #include <rtems.h> 25 #include <cpu.h>26 25 #include <bsp.h> 27 26 … … 48 47 static int First = 1; 49 48 if ( First ) { 50 51 49 /* install ISR */ 50 set_vector( timerisr, 0x8, 0 ); 52 51 53 54 55 56 52 /* Wait for ISR to be called at least once */ 53 Ttimer_val = 0; 54 while ( Ttimer_val == 0 ) 55 continue; 57 56 58 59 60 61 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); 62 61 63 62 First = 0; 64 63 } 65 64 Ttimer_val = 0; /* clear timer ISR count */ … … 67 66 } 68 67 69 #define AVG_OVERHEAD 70 #define LEAST_VALID 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 */ 71 70 72 71 … … 87 86 88 87 if ( Timer_driver_Find_average_overhead == 1 ) 89 88 return total; 90 89 else if ( total < LEAST_VALID ) 91 return 0;/* below timer resolution */90 return 0; /* below timer resolution */ 92 91 else 93 92 return total - AVG_OVERHEAD; 94 93 } 95 94
Note: See TracChangeset
for help on using the changeset viewer.