This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] MSP430FR2355:中断

Guru**** 2388010 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1101452/msp430fr2355-interrupts

部件号:MSP430FR2355

大家好,大家好:

我有一些关于中断的问题。 我的工作目标是按2.3 ,让LED闪烁,然后按针4.1 关闭LED。

 以下是我的代码,试图达到目标。 但是,调试器显示错误“#1.0234万-D未解析的符号仍然存在 ”。

我不能解决问题,希望 有人能帮我解决问题。  

问题是 代码中同时存在的中断不多?     

感谢你的帮助。

 

  

#include <driverlib.h>
#define one_second 50万

/**
主要c
*/
void initGPIO (void);
void inGPIO (void);

Void主(void)

// volatile unsigned short usiButton1 = 1;
// gPIO_setAsInputPinWithPullUpResister( gPIO_PORT_P2, gPIO_PIN3 );
WDTCTL = WDTPW | WDTHOLD;//停止看门狗计时器

GPIO设置输出引脚(GPIO_PORT_P1, GPIO _PIN0);

GPIO_setOutputLowOnPin (GPIO端口P1,GPIO _PIN0);
pm_unlockLPM5();

GPIO_setAsInputPinWithPullUpResister( GPIO_PORT_P4, GPIO PIN1);
GPIO_setAsInputPinWithPullUpResister( GPIO_PORT_P2, GPIO _PIN3);
initGPIO ();
iniGPIO ();
__bis_sr_register( GIE );

}

void initgPIO(void){

pm_unlockLPM5();


GPIO_setAsInputPinWithPullUpResister( GPIO_PORT_P2, GPIO _PIN3);

GPIO选择InterruptEdge (GPIO端口P2,GPIO PIN3,GPIO低至高转换);

GPIO_clearInterrupt (GPIO端口P2,GPIO PIN3);

GPIO_enableInterrupt (GPIO端口P2,GPIO _PIN3);

}

void inGOIP(void){


pm_unlockLPM5();

GPIO_setAsInputPinWithPullUpResister( GPIO_PORT_P4, GPIO PIN1);

GPIO选择InterruptEdge (GPIO端口P4,GPIO PIN1,GPIO低至高转换);

GPIO_clearInterrupt (GPIO端口P4,GPIO PIN1);

GPIO_enableInterrupt (GPIO端口P4,GPIO _PIN1);

}

#pragma vector=port2_vector
__interrupt void按钮_isr (void)

Switch(__均匀_in_range(P2IV,0*10)){

案例P2IV_NONE:
__no_operation();
中断;
案例P2IV_P2IFG0:
__no_operation();
中断;
案例P2IV_P2IFG1:
__no_operation();
中断;
案例P2IV_P2IFG2:
__no_operation();
中断;
案例P2IV_P2IFG3:

同时(1){GPIO _setOutputHighOnPin (GPIO端口P1,GPIO _PIN0);
_DELAY周期(一秒);
GPIO _setOutputLowOnPin (GPIO端口P1,GPIO _PIN0);
_DELAY周期(一秒);
}

案例P2IV_P2IFG4:
__no_operation();
中断;
案例P2IV_P2IFG5:
__no_operation();
中断;
案例P2IV_P2IFG6:
__no_operation();
中断;
案例P2IV_P2IFG7:
__no_operation();
中断;

默认值:_Never执行();
}}


#pragma vector=Port4_vector
__interrupt void pushbutton1_ISR (void)

Switch(__sent_in_range(P4IV,0*10)){

案例P4IV_NONE:
__no_operation();
中断;
案例P4IV_P4IFG0:
__no_operation();
中断;
案例P4IV_P4IFG1:
GPIO _setOutputLowOnPin (GPIO端口P1,GPIO _PIN0);
中断;
案例P4IV_P4IFG2:
__no_operation();
中断;
案例P4IV_P4IFG3:
__no_operation();
中断;
案例P4IV_P4IFG4:
__no_operation();
中断;
案例P4IV_P4IFG5:
__no_operation();
中断;
案例P4IV_P4IFG6:
__no_operation();
中断;
案例P4IV_P4IFG7:
__no_operation();
中断;

默认值:_Never执行();
}
}

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您不会说哪些符号未解析。 但由于您在开始时不包含msp430.h,这就可以了。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    很抱歉,我没有澄清哪些符号可能未解决。  

    添加#include<MSP4S.h>后,错误似乎仍然存在。  

    下面是编译器显示的错误,但我似乎仍然无法理解 哪些符号可能是错误的

    未解决。   我非常感谢你们的帮助。  

      

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我也无法判断,因为您的屏幕截图会切断窗口中显示哪些符号未解析的部分。