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.
在SCI使能中断函数
void sciEnableNotification(sciBASE_t *sci, uint32_t flags)
{
uint32_t index = sci == sciREG ? 0 : 1;
g_sciTransfer[index].mode |= (flags & SCI_TX_INT);
sci->SETINT = (flags & ~SCI_TX_INT);
}
|
Bo shi,
这个是中断进不了还是sciNotification()进不去呢?你可以打断点看看。
在你的程序里面sciNotification()应该是进不去的,你需要初始化rx_length变量不为0;如果是连中断都进不去,你可以看看硬件连线或者引脚波形是否正确。
Best Regards,
Sam
仔细看中断处理中的这段代码:
case 11U:
/* receive */
byte = (uint8)(scilinREG->RD & 0x000000FFU);
if (g_sciTransfer_t.rx_length > 0U)
{
*g_sciTransfer_t.rx_data = byte;
/*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
g_sciTransfer_t.rx_data++;
g_sciTransfer_t.rx_length--;
if (g_sciTransfer_t.rx_length == 0U)
{
sciNotification(scilinREG, (uint32)SCI_RX_INT);
}
}
break;
如果g_sciTransfer_t.rx_length不初始化为非0的话,sciNotification根本进不去。
一般在调用sciReceive的时候会初始化rx_length,但是你的程序中没有调用这个函数,也没有初始化rx_length。
不知道你的linLowLevelInterrupt中断能不能进?