主题中讨论的其他器件:HALCOGEN
您好!
我创建了一个项目来运行 SCI2/LIN 驱动程序、如本视频中所述。 网址:https://www.youtube.com/watch?v=PpalANwuzIo
该项目按索赔的方式运作,罚款。
但是、我对 HalCogen 生成的 ISR "linHighLevelInterrupt()"感到困惑。 在此 ISR 中、不清除 Rx 中断。
难道我们不应该将挂起的中断作为 ISR 中的第一件事来清除?
您能否解释为什么不在此 ISR 中清除 Rx 中断? 下面是 HalcogGen 生成的 ISR。
提前感谢、
================================================================================
void linHighLevelInterrupt (void)
{
uint32 vec = scilinREG->INTVECT0;
uint8字节;
/*用户代码开始(35)*/
/*用户代码结束*/
开关(VEC)
{
案例1U:
sciNotification (scilinREG、(uint32) SCI_WAKE_INT);
中断;
案例3U:
sciNotification (scilinREG、(uint32) SCI_PE_INT);
中断;
案例6U:
sciNotification (scilinREG、(uint32) SCI_FE_INT);
中断;
案例7U:
sciNotification (scilinREG、(uint32) SCI_break_INT);
中断;
案例9U:
sciNotification (scilinREG、(uint32) SCI_OE_INT);
中断;
案例11U:
/*接收*/
字节=(uint8)(scilinREG->RD & 0x000000FFU);
如果(g_sciTransfer_t[1U].rx_length > 0U)
{
*g_sciTransfer_t[1U].rx_data =字节;
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
G_sciTransfer_t[1U].rx_data++;
g_sciTransfer_t[1U].rx_length--;
如果(g_sciTransfer_t[1U].rx_length == 0U)
{
sciNotification (scilinREG、(uint32) SCI_RX_INT);
}
}
中断;
案例12U:
/*发送*/
/*SAFETYMCUSW 30 S MR:12.2、12.3 "用于发送/接收轮询和中断模式下的数据计数"*/
-g_sciTransfer_t[1U].TX_length;
如果(g_sciTransfer_t[1U].TX_length > 0U)
{
uint8 txdata =* g_sciTransfer_t[1U].TX_data;
scilinREG->TD =(uint32)(txdata);
/*SAFETYMCUSW 567 S MR:17.1,17.4 "需要指针增量"*/
G_sciTransfer_t[1U].TX_DATA++;
}
其他
{
scilinREG->CLEARINT =(UINT32) SCI_TX_INT;
sciNotification (scilinREG、(uint32) SCI_TX_INT);
}
中断;
默认值:
/*幻象中断、清除标志并返回*/
scilinREG->FLR =~scilinREG->SETINLVL & 0x07000303U;
中断;
}