[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: can't compile gcctest9
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Re: can't compile gcctest9 |
Date: |
Wed, 5 Mar 2003 13:54:18 +0100 (MET) |
In article <address@hidden> you write:
>I changed
>#define get_ticks() __inw_atomic(TCNT1)
>in "timer.h"
>
>TO
>#define get_ticks() _SFR_WORD(TCNT1)
Hmm, be careful, don't do this if it's not guaranteed that
interrupts won't disturb it.
Otherwise, use
inline uint16_t
get_ticks(void)
{
uint16_t rv;
uint8_t sreg;
sreg = SREG;
cli();
rv = TCNT1;
SREG = sreg;
return rv;
}
>| JA1FMZ, MoroisoYachtOwnersClub, exJapanMotorGliderClub |
73 de DL8DTL
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/