avrdudes / avr-libc

The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
https://avrdudes.github.io/avr-libc/
Other
261 stars 56 forks source link

[bug #30757] CPU_t not implemented in iox128a1.h #454

Closed avrs-admin closed 2 years ago

avrs-admin commented 2 years ago

Thu 12 Aug 2010 02:34:58 PM CEST

The headerfile iox128a1.h is missing typedef for CPU_t. Compile error: 'CPU_t' undeclared when trying to write to CPU.CCP

This issue was migrated from https://savannah.nongnu.org/bugs/?30757

avrs-admin commented 2 years ago

Joerg Wunsch Thu 12 Aug 2010 02:38:10 PM CEST

This appears to be a duplicate for bug #28901 which has been fixed in version 1.7.0.

Please confirm that this version actually fixes also your problem.

avrs-admin commented 2 years ago

Ragnar Ranøyen Homb Thu 12 Aug 2010 03:13:27 PM CEST

With the new iox128a1.h (from 1.7.0) i get the error: ... 'CPU' undeclared ... when trying to access CPU.CPP

avrs-admin commented 2 years ago

Joerg Wunsch Thu 12 Aug 2010 03:24:04 PM CEST

This appears to be intentional:

r2116 | aboyapati | 2010-04-06 05:57:30 +0200 (Tue, 06 Apr 2010) | 20 lines

2010-03-31  Anitha Boyapati anitha.boyapati@atmel.com

Fix bug #28901.

Maybe Anitha can comment on why they are not supposed to be present.

avrs-admin commented 2 years ago

Anitha Boyapati Wed 22 Sep 2010 02:50:47 PM CEST

Firstly, sorry for not responding earlier. I think I missed this bug.

The bug28901 talks about missing CPU_t and GPIO_t definitions only. I think definitions for CPU and GPIO should not have been removed. Upon that I created the patch in the first place!

My fix for this would look something like below (taken only for iox128a1.h). Please review if this looks fine. I shall extend it to rest of xmega header files.

Index: iox128a1.h

--- iox128a1.h  (revision 2187) +++ iox128a1.h  (working copy) @@ -2552,12 +2552,13 @@ IO Module Instances. Mapped to memory.

*/

+#define GPIO      (0x0000)  / General Purpose IO Registers /

define VPORT0    ((VPORT_t ) 0x0010)  / Virtual Port 0 /

define VPORT1    ((VPORT_t ) 0x0014)  / Virtual Port 1 /

define VPORT2    ((VPORT_t ) 0x0018)  / Virtual Port 2 /

define VPORT3    ((VPORT_t ) 0x001C)  / Virtual Port 3 /

define OCD    ((OCD_t ) 0x002E)  / On-Chip Debug System /

+#define CPU       (0x0030)  / CPU Registers /

define CLK    ((CLK_t ) 0x0040)  / Clock System /

define SLEEP    ((SLEEP_t ) 0x0048)  / Sleep Controller /

define OSC    ((OSC_t ) 0x0050)  / Oscillator Control /

avrs-admin commented 2 years ago

Eric Weddington Thu 23 Sep 2010 06:26:16 AM CEST

Hi Anitha,

Actually, IIRC, I asked you to just remove those definitions from the header file. Also, IIRC, the registers that would normally be in the CPU_t and GPIO_t structures are defined as "global" registers, meaning that they should not be buried in a structure of registers anywhere.

Also, if this bug is marked as a Duplicate, then go ahead and set the bug to Closed.

Eric