Running Linker
clnk -m Debug\led1.map -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -o Debug\led1.sm8 Debug\led1.lkf
#error clnk Debug\led1.lkf:1 symbol _EXTI_SetExtIntSensitivity not defined (Debug\main.o )
#error clnk Debug\led1.lkf:1 symbol _EXTI_DeInit not defined (Debug\main.o )
The command: "clnk -m Debug\led1.map -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -o Debug\led1.sm8 Debug\led1.lkf " has failed, the returned value is: 1
exit code=1.
#error clnk Debug\led1.lkf:1 symbol _EXTI_SetExtIntSensitivity not defined (Debug\main.o )
#error clnk Debug\led1.lkf:1 symbol _EXTI_DeInit not defined (Debug\main.o )
这里两个函数未定义;你直接把代码贴出来吧
用的话更方便;
----------- Project led1 - STM8 Cosmic - Configuration Debug -------------
Compiling src\encode.c...
cxstm8 -i..\..\stvd\en.stsw-stm8023\an3279\libraries\stm8_touchsensing_driver\inc -i..\stvd.h\stm8s_stdperiph_driver\inc -i..\..\stvd\en.stsw-stm8023\an3279\project\discover\inc -iinc -i..\123 -i..\库文件\stm8_touchsensing_driver\inc -i..\库文件\stm8s_stdperiph_driver\inc -i..\..\stvd库文件\en.stsw-stm8023\an3279\libraries\stm8s_stdperiph_driver\inc -i..\..\stvd库文件\en.stsw-stm8023\an3279\project\discover\inc +debug -pxp -no -l +mods0 -pp -i"C:\Program Files (x86)\COSMIC\CXSTM8\Hstm8" -i"C:\Program Files (x86)\STMicroelectronics\st_toolset\include" -clDebug\ -coDebug\ src\encode.c
src\encode.c:
Running Linker
clnk -m Debug\led1.map -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -o Debug\led1.sm8 Debug\led1.lkf
#error clnk Debug\led1.lkf:1 symbol _EXTI_SetExtIntSensitivity not defined (Debug\main.o )
#error clnk Debug\led1.lkf:1 symbol _EXTI_DeInit not defined (Debug\main.o )
The command: "clnk -m Debug\led1.map -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -l"C:\Program Files (x86)\COSMIC\CXSTM8\Lib" -o Debug\led1.sm8 Debug\led1.lkf " has failed, the returned value is: 1
exit code=1.
led1.elf - 4 error(s), 0 warning(s)
我写了一个编码器程序,编译出错了。能不能告诉我这是什么问题引起的错误
#error clnk Debug\led1.lkf:1 symbol _EXTI_DeInit not defined (Debug\main.o )
这里两个函数未定义;你直接把代码贴出来吧
/*********************************************************
TMA-1A控制程序
功能:键盘和编码电位器
**********************************************************/
#include "stm8s.h"
#include "encode.h"
#include "led.h"
#include "exti.h"
unsigned char ENCODE_LED_State=0; //编码电位器LED状态
unsigned char ENCODE_LEDTIME=0; //编码电位器LED计时
u8 RotaryEncoder_STATE = DISABLE;
unsigned char RotaryEncoderData=0;
void RotaryEncoder_Handler(void)
{
unsigned char a,b,c,d;
delay_ms(1); //滤除干扰信号
a=RotaryEncoder1;
b=RotaryEncoder2;
if(a == 0) RotaryEncoderData = RotaryEncoderData << 1;
else RotaryEncoderData = (RotaryEncoderData<<1)|0x01;
if(b == 0) RotaryEncoderData = RotaryEncoderData << 1;
else RotaryEncoderData = (RotaryEncoderData<<1)|0x01;
switch(RotaryEncoderData)
{
case 0x4B:
RotaryEncoder_STATE = RIGHT;
RotaryEncoderData = 0;
break;
case 0x87:
RotaryEncoder_STATE = LEFT;
RotaryEncoderData = 0;
break;
default :
break;
}
}
void EncodeFunctionsCheck(void)
{
if(RotaryEncoderIRQ == DISABLE) return;
RotaryEncoder_Handler();
if(RotaryEncoder_STATE != DISABLE)
{
switch(RotaryEncoder_STATE)
{
case LEFT:
//ENCODE_LED_State = ENABLE;
//ENCODE_LEDTIME=0;
GPIO_WriteReverse(GPIOD, GPIO_PIN_7);
break;
case RIGHT:
//ENCODE_LED_State = ENABLE;
//ENCODE_LEDTIME=0;
GPIO_WriteReverse(GPIOD, GPIO_PIN_7);
break;
default :
break;
}
RotaryEncoder_STATE = DISABLE;
}
RotaryEncoderIRQ = DISABLE;
RotaryEncoder_IRQ_ENABLE;
}
#define __ENCODE_H
#include "exti.h"
#include "stm8s.h"
#include "led.h"
void EncodeFunctionsCheck(void);
/**********************************************************
* *
* 编码电位器控制引脚定义 *
* *
**********************************************************/
#define ENABLE 1
#define DISABLE 0
#define RUN 2
#define TRUE 1
#define FALSE 0
#define HIGH 1
#define LOW 0
#define PASS 1
#define FAIL 0
#define LEFT 1
#define RIGHT 2
//#define LED1_Port GPIOD //定义ENCODE数据端口
//#define LED1_PIN GPIO_PIN_7
#define RotaryEncoderPort GPIOB //定义ENCODE数据端口
//#define PWM2_PORT GPIOE
#define RotaryEncoder_EXTI_PORT EXTI_PORT_GPIOB
#define RotaryEncoder1_PIN GPIO_PIN_6
#define RotaryEncoder2_PIN GPIO_PIN_7
#define RotaryEncoder1 GPIO_ReadInputPin(RotaryEncoderPort, RotaryEncoder1_PIN) //定义编码电位器引脚
#define RotaryEncoder2 GPIO_ReadInputPin(RotaryEncoderPort, RotaryEncoder2_PIN) //定义编码电位器引脚
#define RotaryEncoder_IRQ_DISABLE GPIO_Init(RotaryEncoderPort, (RotaryEncoder1_PIN|RotaryEncoder2_PIN), GPIO_MODE_IN_PU_NO_IT);
#define RotaryEncoder_IRQ_ENABLE GPIO_Init(RotaryEncoderPort, (RotaryEncoder1_PIN|RotaryEncoder2_PIN), GPIO_MODE_IN_PU_IT);
#include "stm8s.h"
#include "exti.h"
#include "encode.h"
#include "led.h"
FunctionalState RotaryEncoderIRQ = DISABLE;
/*****************
@far @interrupt void KEY_IRQ(void)
{
if(KEY_DOWN == DISABLE) KEY_DOWN = ENABLE;
GPIO_Init(BUTTONS_PORT,(Y0|Y1|Y2), GPIO_MODE_IN_PU_NO_IT);
}
**********************/
/**********************************************************
编码电位器中断
**********************************************************/
@far @interrupt void RotaryEncoder_IRQHandler(void)
{
RotaryEncoderIRQ = ENABLE;
RotaryEncoder_IRQ_DISABLE;
}
#define __EXTI_H
/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"
#include "encode.h"
#include "led.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
extern FunctionalState RotaryEncoderIRQ;
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* Remote */
//@far @interrupt void GPIOB_IRQHandler(void);
@far @interrupt void RotaryEncoder_IRQHandler(void);
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
#endif