avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] fuse API on the xmega16a4


From: Galen Seitz
Subject: Re: [avr-libc-dev] fuse API on the xmega16a4
Date: Sat, 13 Mar 2010 10:55:41 -0800
User-agent: Thunderbird 2.0.0.22 (X11/20090625)

Weddington, Eric wrote:
-----Original Message-----
The fuse API documentation doesn't seem to quite match up with the xmega implementation. I tried using the FUSES macro, but it doesn't appear to be defined when targeting an xmega16a4. However, the following does work.

/* Configure fuses. */
NVM_FUSES_t __fuse FUSEMEM = {
   .FUSEBYTE0 = FUSE0_DEFAULT,
   .FUSEBYTE1 = 0x00,
   .FUSEBYTE2 = (FUSE_BODPD0),
   .FUSEBYTE4 = FUSE4_DEFAULT,
   .FUSEBYTE5 = (FUSE_BODACT0 & FUSE_BODLVL2 & FUSE_BODLVL0)
};


Is this a user error, a bug, or is the xmega fuse API intentionally different?

My guess is that the API is intentionally different. However, it's a bug in 
that avr-libc is not correctly accounting for the differences. That's something 
we need to fix.

Would something like this be appropriate?

--- /usr/avr/include/avr/fuse.h 2010-03-10 16:32:49.000000000 -0800
+++ fuse.h      2010-03-13 10:54:26.000000000 -0800
@@ -261,8 +261,12 @@
 #endif

 #ifndef FUSES
+#ifdef __AVR_XMEGA__
+#define FUSES NVM_FUSES_t __fuse FUSEMEM
+#else
 #define FUSES __fuse_t __fuse FUSEMEM
 #endif
+#endif

 #endif /* !__ASSEMBLER__ */


--
Galen Seitz
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]