[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual
From: |
Harald Kipp |
Subject: |
Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual |
Date: |
Wed, 18 Jul 2007 19:32:17 +0200 |
User-agent: |
Thunderbird 1.5.0.12 (Windows/20070509) |
Answering my own questions:
No idea what __init() is intended to do, but it won't help: No
initialized stack pointer, no return.
Using any earlier section than .init3 provides another problem: No
initialized __zero_reg__, no MCUSR or watchdog clear.
To avoid overriding the mirror variable, I added an attribute to it.
u_char mcusr_mirror __attribute__ ((section (".noinit")));
I'd suggest to add this to the watchdog section of the manual.
If it is required to use .init0 (in my case it is), this should work:
void get_mcusr(void) \
__attribute__((naked)) \
__attribute__((section(".init0")));
void get_mcusr(void)
{
asm volatile ("clr __zero_reg__");
mcusr_mirror = MCUSR;
MCUSR = 0;
wdt_disable();
}
If you discover any other problems in this code, please let me know.
Harald
- RE: [avr-libc-dev] New device support, (continued)
- Re: [avr-libc-dev] New device support, Dmitry K., 2007/07/15
- Re: [avr-libc-dev] New device support, Bob Paddock, 2007/07/15
- Re: [avr-libc-dev] New device support, Joerg Wunsch, 2007/07/15
- Re: [avr-libc-dev] New device support, Bob Paddock, 2007/07/17
- Re: [avr-libc-dev] New device support, Joerg Wunsch, 2007/07/18
- [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual, Harald Kipp, 2007/07/18
- Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual,
Harald Kipp <=
- Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual, Joerg Wunsch, 2007/07/18
- Re: [avr-libc-dev] Hint For Watchdog Disable on Newer AVRs in the Manual, Harald Kipp, 2007/07/19
Re: [avr-libc-dev] New device support, Joerg Wunsch, 2007/07/15