我很难发现我在哪里犯了错误,不知道如何用谷歌搜索解决方案。我收到以下错误:
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 中:
#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
和 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;
}
}
任何援助将不胜感激