PORT-Deklaration fehlerhaft

OP #5365535
Lesenswert?

Hallo.
Finde nicht die Ursache folgender Fehlermeldungen;

Severity  Code  Description        Line  Column
Error    'PORTA' undeclared (first use in this function)  91  39
Error    'PORTA' undeclared (first use in this function)  91  39
Error    'PA0' undeclared (first use in this function)  91  45
Error    'PA1' undeclared (first use in this function)  93  47
Error    'PORTA' undeclared (first use in this function)  94  37
Error    'PA2' undeclared (first use in this function)  94  43
u.s.w.
Betrifft alle Ein/Ausgänge der "PA"-Pins

Würdet ihr mir bitte einen Tip geben?
Was stimmt an folgender Deklaration nicht?

#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
// Ausgänge schalten
#define AUSGANG_SET_HIGH(port,mask) ((port) |= (1<<mask))
// Ausgangs-Port einschalten // Zeile 87
#define AUSGANG_SET_LOW(port,mask) ((port) &= ~(1<<mask))
// Ausgangs-Port ausschalten // Zeile 88

#define LED_HELL_ON (AUSGANG_SET_HIGH(PORTA,PA0))
// LED/hell ein, Port PA0 // Zeile 90
#define LED_HELL_OFF (AUSGANG_SET_LOW(PORTA,PA0))
// LED/hell aus, Port PA0 // Zeile 91
#define LED_DUNKEL_ON (AUSGANG_SET_HIGH(PORTA,PA1))
// LED/dunkel ein, Port PA1 // Zeile 92
#define LED_DUNKEL_OFF (AUSGANG_SET_LOW(PORTA,PA1))
// LED/dunkel aus, Port PA1 // Zeile 93
#define LED_GN_ON (AUSGANG_SET_HIGH(PORTA,PA2))
// LED/EnergZust/gn ein, Port PA2 // Zeile 94
...
int main(void)
{
DDRA &= ~((1<<PA7)|(1<<PA6));
// Eingang
DDRB &= ~((1<<PB2)|(1<<PB3));
// Eingang
DDRA |= ((1<<PA0)|(1<<PA1)|(1<<PA2)|(1<<PA3)|(1<<PA4)|(1<<PA5));
// Ausgang
...

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren