[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] cannot access TCC0.PER or any other 16-bit register o
From: |
Bob Paddock |
Subject: |
Re: [avr-libc-dev] cannot access TCC0.PER or any other 16-bit register on ATXMega128A1 |
Date: |
Sun, 18 Sep 2011 08:16:44 -0400 |
On Sun, Sep 18, 2011 at 7:54 AM, Stefan Schoenleitner
<address@hidden> wrote:
> ------------------------------
> $ avr-gcc -Os -gstabs -std=c99 -funsigned-char -funsigned-bitfields
> -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -pedantic
> -mmcu=atxmega128a1 -c -o main.o main.c
> main.c: In function ‘main’:
> main.c:130: error: ‘TC0_t’ has no member named ‘PER’
> make: *** [main.o] Error 1
> Since "PER" is definitely in the struct, I'm really wondering why I get the
> compiler error above.
> I suppose this is a bug.
I'm sure it would have been noticed by now if the 16 bit stuff did not work.
I use code like this all of the time:
/* Setup the period to next IRQ */
TCD0.CTRLA = TC_CLKSEL_OFF_gc;
TCD0.PERBUF = period_u16;
TCD0.CCABUF = period_u16;
TCD0.CTRLB = (TC_WGMODE_NORMAL_gc);
TCD0.INTCTRLA = 0;
TCD0.INTCTRLB = TC_CCAINTLVL_LO_gc; /* Enable D0.B IRQ */
Does your code compile if you use:
# Debugging format.
# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
# AVR Studio 4.10 requires dwarf-2.
# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2
# Compiler flag to set the C Standard level.
# c89 = "ANSI" C
# gnu89 = c89 plus GCC extensions
# c99 = ISO C99 standard (not yet fully implemented)
# gnu99 = c99 plus GCC extensions
CSTANDARD = -std=gnu99
To me it looks like your Makefile is rather old. Does your code
compile if you use a Makefile produced by MFile (Which you many not
have, being it comes with WinAVR)?
--
http://blog.softwaresafety.net/
http://www.designer-iii.com/
http://www.wearablesmartsensors.com/