0
我无法识别我犯的错误,并且不知道如何google解决方案。我收到以下错误:AVR-GCC - 包含头文件的枚举错误
#ifndef DEBUG_MODE_HEADER
#define DEBUG_MODE_HEADER
#include "uart.h"
#include <stdbool.h>
#include <avr/pgmspace.h>
#include "buttons.h"
bool DebugModeEnabled = false;
void SetDebugMode();
void AnnounceDebugMode(bool State);
void DebugAnnounceLEDState();
void DebugAnnounceButtonState(ButtonFlags Button);
#endif
和:
In file included from buttons.h:8,
from buttons.c:1:
debug_mode.h:14: error: expected ')' before 'Button'
我有一个枚举在buttons.h
#ifndef BUTTONS_HEADER
#define BUTTONS_HEADER
#include <avr/io.h>
#include <stdbool.h>
#include <util/delay.h>
#include "uart.h"
#include "debug_mode.h"
typedef enum {
NO_BUTTON,
BUTTON1,
BUTTON2,
BUTTON3,
BUTTON4,
BUTTON5,
BUTTON6
}
ButtonFlags;
void CheckButtons();
void SetButtonFlag();
void ProcessButtons();
#endif
我包括它在另一个头debug_mode.h声明debug_mode.c:
#include "debug_mode.h"
void DebugAnnounceButtonState(ButtonFlags Button)
{
SendUARTString_P(DEBUGMODE_BUTTON_PRESSED_MSG);
switch (Button)
{
case 1: SendUARTString_P(DEBUGMODE_BUTTON1_MSG); break;
default: break;
}
}
A倪援助
我发现一个包含循环。你包括buttons.h其中包括debug_mode.h,其中包括button.h ... –