|
一直没弄清楚freertos的中断如何写,入口必须使用汇编吗?
没用汇编写也能运行?
求解!!!
void xPortSysTickHandler( void )
{
unsigned long ulDummy;
/* If using preemption, also force a context switch. */
#if configUSE_PREEMPTION == 1
*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
#endif
ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
{
vTaskIncrementTick();
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}
/*-----------------------------------------------------------*/
void xPortUSART1rxHandler(void)
{
unsigned long ulDummy;
static unsigned char test[5];
static unsigned char n;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
{
test[n]=USART_ReceiveData(USART1);
if(++n>4){
n=0;
//xQueueSendFromISR(Queue1,&test[0],&xHigherPriorityTaskWoken);
USART_SendData(USART1,test[3]);
}
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
} |
|