[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] 32-bits time
From: |
Galen Seitz |
Subject: |
Re: [avr-gcc-list] 32-bits time |
Date: |
Wed, 12 Oct 2005 16:22:59 -0700 |
What about something like this:
uint16_t upper, lower;
uint32_t time;
cli();
lower = TCNT1;
upper = hiword_time;
// Force lower bytes to max value if a timer overflow interrupt is pending.
// This assumes the latency on the overflow flag is less than the time it
// takes to execute the previous two statements.
if (timer1 overflow)
lower = 0xffff;
time = upper<<16 | lower;
sei();
galen
- [avr-gcc-list] 32-bits time, Eric Pasquier, 2005/10/12
- RE: [avr-gcc-list] 32-bits time, Gavin Jackson, 2005/10/12
- RE: [avr-gcc-list] 32-bits time, Eric Pasquier, 2005/10/12
- Re: [avr-gcc-list] 32-bits time,
Galen Seitz <=
- Re: [avr-gcc-list] 32-bits time, Eric Pasquier, 2005/10/13
- [avr-gcc-list] After ATMega, Eric Pasquier, 2005/10/13
- Re: [avr-gcc-list] After ATMega, Galen Seitz, 2005/10/13
- Re: [avr-gcc-list] After ATMega, Patrick Blanchard, 2005/10/13
- RE: [avr-gcc-list] After ATMega, Trampas, 2005/10/13
- RE: [avr-gcc-list] After ATMega, Patrick Blanchard, 2005/10/13
Re: [avr-gcc-list] 32-bits time, Dmitry K., 2005/10/13
RE: [avr-gcc-list] 32-bits time, Loveny Design, 2005/10/13