void prvvMBSerialIRQHandler( void ) { portENTER_SWITCHING_ISR( ); static BOOL xTaskWokenReceive = FALSE; static BOOL xTaskWokenTransmit = FALSE; static USHORT usStatus; usStatus = UART_FlagStatus( MB_UART_DEV ); if( prvMBPortTXIsEnabled( ) && ( usStatus & UART_TxHalfEmpty ) ) { xTaskWokenReceive = pxMBFrameCBTransmitterEmpty( ); } if( prvMBPortRXIsEnabled( ) && ( usStatus & UART_RxBufFull ) ) { xTaskWokenReceive = pxMBFrameCBByteReceived( ); } /* End the interrupt in the EIC. */ EIC->IPR |= 1 << EIC_CurrentIRQChannelValue( ); portEXIT_SWITCHING_ISR( ( xTaskWokenReceive || xTaskWokenTransmit ) ? pdTRUE : pdFALSE ); }
void vPortNonPreemptiveTick( void ) { vTaskIncrementTick(); /* Clear the interrupt in the watchdog and EIC. */ WDG->SR = 0x0000; /* clear current interrupt pending flag for interupt source. */ EIC->IPR |= 1 << EIC_CurrentIRQChannelValue(); }
void sio_uart1_irq( void ) { /* Save context to stack. */ portENTER_SWITCHING_ISR( ); static u8_t need_ctx_switch; sio_serial_isr( UART1, &need_ctx_switch ); /* End the interrupt in the EIC. */ EIC->IPR |= 1 << EIC_CurrentIRQChannelValue( ); /* End the ISR. */ portEXIT_SWITCHING_ISR( need_ctx_switch ? pdTRUE : pdFALSE ); }
void vPortPreemptiveTick( void ) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Increment the RTOS tick count, then look for the highest priority * task that is ready to run. */ vTaskIncrementTick(); vTaskSwitchContext(); /* Clear the interrupt in the watchdog and EIC. */ WDG->SR = 0x0000; /* clear current interrupt pending flag for interupt source. */ EIC->IPR |= 1 << EIC_CurrentIRQChannelValue(); /* Restore the context of the new task. */ portRESTORE_CONTEXT(); }