ID undefined.
-
20-12-2019 - |
문제
이것은 나에게 몇 번이나 일어 났으며 나는 그것의 근본 원인을 알아 내려고 노력하고 있습니다.요컨대 나는 무언가가 정의되지 않았다는 것을 말하지 만 근처에있는 것처럼 말하면서 이러한 오류가 있습니다.아래에 표시된 바와 같이, 나는 ~ 6580 라인에 내가 얻는 3 가지 오류를 모두 정의한다 (SSI1CLK, SS1RX, SS1TX는 정의되지 않은 경우)을 포함시켰다.
프로젝트 속성에서 C : \ Stellarisware가 포함되어 있으며 다른 여러 파일에서 정의했습니다.그것은 한 번만 일어나고 나에게 삶을 위해 일어날 수 없습니다.누군가 내가 뭘 잘못하고 있는지 말해 줄 수 있니?
코드 작곡가 스튜디오를 사용하여 TI에서 LM3S2965 평가 보드를 사용하고 있습니다.
#include "inc/lm3s2965.h"
#include "inc/hw_ints.h"
#include "inc/hw_ssi.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/ssi.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
void init_SPI(void){
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
GPIOPinConfigure(GPIO_PE0_SSI1CLK);
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,GPIO_PIN_1);
GPIOPinConfigure(GPIO_PE2_SSI1RX);
GPIOPinConfigure(GPIO_PE3_SSI1TX);
GPIOPinWrite(GPIO_PORTE_BASE,GPIO_PIN_1,GPIO_PIN_1);
SSIDisable(SSI1_BASE);
GPIOPinTypeSSI(GPIO_PORTE_BASE, GPIO_PIN_3 | GPIO_PIN_2 |
GPIO_PIN_0);
SSIConfigSetExpClk(SSI1_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, 1000000, 8);
SSIEnable(SSI1_BASE);
}
.
파일 pin_map.h는 매우 길지만 문제의 정의는 다음과 같습니다.
#define GPIO_PE0_SSI1CLK 0x00040002
#define GPIO_PE0_CCP3 0x00040003
#define GPIO_PE0_EPI0S8 0x00040008
#define GPIO_PE1_SSI1FSS 0x00040402
#define GPIO_PE1_CCP2 0x00040404
#define GPIO_PE1_CCP6 0x00040405
#define GPIO_PE1_EPI0S9 0x00040408
#define GPIO_PE2_CCP4 0x00040801
#define GPIO_PE2_SSI1RX 0x00040802
#define GPIO_PE2_CCP2 0x00040805
#define GPIO_PE2_EPI0S24 0x00040808
#define GPIO_PE3_CCP1 0x00040C01
#define GPIO_PE3_SSI1TX 0x00040C02
#define GPIO_PE3_CCP7 0x00040C05
#define GPIO_PE3_EPI0S25 0x00040C08
.
오류 자체는 다음과 같습니다.
Description Resource Path Location Type
#20 identifier "GPIO_PE0_SSI1CLK" is undefined SPI.c /Sandbox 1v1v1/SPI line 23 C/C++ Problem
. 해결책
pin_map.h가 실제로 DriverLib 디렉토리에 있는지 확인하십시오.또한 이러한 정의를 감싸는 매크로가 있습니까?예 :
#ifdef SOME_MACRO
#define GPIO_PE0_SSI1CLK 0x00040002
#endif
.
#define "some_macro"
가 필요할 수 있습니다.제휴하지 않습니다 StackOverflow