下面的这些代码是 blackfin bf537 的 LED 闪烁程序示例,LED 将从右到左闪烁并切换回。/**/
EX_INTERRUPT_HANDLER(Timer0_ISR)
{
// confirm interrupt handling
*pTIMER_STATUS = 0x0001;
// shift old LED pattern by one, left to right
if(sLight_Move_Direction)
{
if((ucActive_LED = ucActive_LED >> 1) <= 0x0020) ucActive_LED = 0x1000;
}
else
{
if((ucActive_LED = ucActive_LED << 1) == 0x0020) ucActive_LED = 0x0020;
}
// write new LED pattern to PORTF LEDs
*pPORTFIO_TOGGLE = ucActive_LED;
/**/
现在我正在尝试修改代码以完成新功能,我希望它在我按下按钮时从左到右闪烁一次,所以下面有我的代码:/**/
EX_INTERRUPT_HANDLER(Timer0_ISR)
{
// confirm interrupt handling
*pTIMER_STATUS = 0x0001;
// shift old LED pattern by one, left to right
if(sLight_Move_Direction){
ucActive_LED == 0x0800;
ucActive_LED = ucActive_LED >> 1;
ucActive_LED == 0x0040;
}
// write new LED pattern to PORTF LEDs
*pPORTFIO_TOGGLE = ucActive_LED;
/**/
现在它无法工作或只是闪烁 LED3,我该如何解决?
谢谢