interrupt void serial_erro(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Tratamento da interrupção (void)UART_STAT1; /* Leitura do registrador SCI1S1 para analisar o estado da transmissão */ (void)UART_CTRL3; /* Leitura do registrador SCI1C3 para limpar o bit de paridade */ // A próxima ação depende do tipo de erro // Devemos analisar o erro ocorrido e tomar uma das atitudes abaixo (void)UART_DATA; // Leitura do registrador SCI1D para limpar os indicativos de erro. UART_DATA = 0; // Escrita no registrador SCI1D para limpar os indicativos de erro. #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
interrupt void Timer2Overflow(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Interrupt handling TPM2SC_TOF = 0; #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif // ************************ // Handler code for the tick // ************************ TimerOverflowCallback(); #if (SD_WAVE == 1) OSSemPost(Audio); #endif // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
void uart2_error(void) { // ************************ // Interrupt Entry // ************************ #if __GNUC__ OS_SAVE_ISR(); #endif OS_INT_ENTER(); // Tratamento da interrupção (void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */ (void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */ // A próxima ação depende do tipo de erro // Devemos analisar o erro ocorrido e tomar uma das atitudes abaixo (void) SCI2D; // Leitura do registrador SCIxD para limpar os indicativos de erro. SCI2D = 0; // Escrita no registrador SCIxD para limpar os indicativos de erro. #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ #if __GNUC__ OS_RESTORE_ISR(); #endif }
interrupt void serial_tx(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Tratamento da interrupção UART_CTRL2 &= ~(1<<6); (void)UART_STAT1; /* Leitura do registrador para analisar o estado da transmissão */ (void)UART_CTRL3; /* Leitura do registrador para limpar o bit de paridade */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif (void)OSSemPost(SerialTX); // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
interrupt void serial_rx(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Tratamento da interrupção (void)UART_STAT1; /* Leitura do registrador SCI1S1 para analisar o estado da transmissão */ (void)UART_CTRL3; /* Leitura do registrador SCI1C3 para limpar o bit de paridade */ receive_byte = UART_DATA; /* Leitura dos dados recebidos */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif if (OSQueuePost(Serial, receive_byte) == BUFFER_UNDERRUN) { // Problema: Estouro de buffer OSCleanQueue(Serial); } // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
interrupt void uart2_rx(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Tratamento da interrupção (void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */ (void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */ receive_byte2 = SCI2D; /* Leitura dos dados recebidos */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif if (OSQueuePost(Serial2, receive_byte2) == BUFFER_UNDERRUN) { // Problema: Estouro de buffer OSCleanQueue(Serial2); } // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
interrupt void uart2_tx(void) #endif { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Tratamento da interrupção SCI2C2_TCIE = 0; (void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */ (void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif //pxMBFrameCBTransmitterEmpty(); (void) OSSemPost(SerialTX2); // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
/* ISR(TIMER1_OVF_vect) @des interruption du pwm au 5mS */ ISR(TIMER1_OVF_vect,ISR_NAKED) { OS_INT_ENTER(); OCR1A=pwmOCR1A_value; OCR1B=pwmOCR1B_value; pwmPortDREG.bit.b4=1; pwmPortDREG.bit.b5=1; PORTD=pwmPortDREG.byte; OSSemPost(MoteurUpdateSem); OS_INT_EXIT(); }
/************************************************************//** * \fn interrupt void SwitchContext(void) * \brief Software interrupt handler routine (Internal kernel function). * Used to switch the tasks context. ****************************************************************/ interrupt void SwitchContext(void) { // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Interrupt Handling // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ }
void SwitchContext(void) { // ************************ // Entrada de interrup��o // ************************ OS_SAVE_ISR(); OS_INT_ENTER(); // Interrupt Handling // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); OS_RESTORE_ISR(); // ************************ }
void SwitchContext(void) { // as MSP430 does not have sw interrupt, we save 7 regs to make it appear like one. // save 7 regs OS_SAVE_ISR(); // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // Interrupt Handling // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ OS_RESTORE_ISR(); }
void TickTimer(void) { // ************************ // Entrada de interrupção // ************************ OS_SAVE_ISR(); OS_INT_ENTER(); // Interrupt handling TICKTIMER_INT_HANDLER; OSIncCounter(); // BRTOS TRACE SUPPORT #if (OSTRACE == 1) #if(OS_TICK_SHOW == 1) #if(OS_TRACE_BY_TASK == 1) Update_OSTrace(0, ISR_TICK); #else Update_OSTrace(configMAX_TASK_INSTALL - 1, ISR_TICK); #endif #endif #endif #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif // ************************ // Handler code for the tick // ************************ OS_TICK_HANDLER(); // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); OS_RESTORE_ISR(); // ************************ }
void uart2_tx(void) { // ************************ // Interrupt Entry // ************************ #if __GNUC__ OS_SAVE_ISR(); #endif OS_INT_ENTER(); // Tratamento da interrupção #if (__GNUC__) BITCLEARMASK(SCI2C2,SCI2C2_TCIE_MASK); #else SCI2C2_TCIE = 0; #endif (void) SCI2S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */ (void) SCI2C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif (void) OSSemPost(SerialTX2); // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ #if __GNUC__ OS_RESTORE_ISR(); #endif }
interrupt void Radio_Interrupt(void) #endif { #if PROCESSOR == COLDFIRE_V1 // ************************ // Entrada de interrupção // ************************ OS_INT_ENTER(); // ************************ #endif // Tratamento da interrupção (void)RFFLAG; // Lê o registrador RFIF; // Limpa a flag de interrupção do registrador // Desabilita interrupção de hardware ligada ao pino INT RFIINT_DISABLE; #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif OSSemPost(RF_Event); // ************************ // Saída de interrupção // ************************ #if PROCESSOR == COLDFIRE_V1 OS_INT_EXIT(); // ************************ #endif #if PROCESSOR == ARM_Cortex_M0 OS_INT_EXIT_EXT(); // ************************ #endif }
void uart1_rx(void) { // ************************ // Interrupt Entry // ************************ #if __GNUC__ OS_SAVE_ISR(); #endif OS_INT_ENTER(); // Tratamento da interrupção (void) SCI1S1; /* Leitura do registrador SCIxS1 para analisar o estado da transmissão */ (void) SCI1C3; /* Leitura do registrador SCIxC3 para limpar o bit de paridade */ receive_byte1 = SCI1D; /* Leitura dos dados recebidos */ #if (NESTING_INT == 1) OS_ENABLE_NESTING(); #endif if (OSQueuePost(Serial1, receive_byte1) == BUFFER_UNDERRUN) { // Problema: Estouro de buffer OSQueueClean(Serial1); } // ************************ // Interrupt Exit // ************************ OS_INT_EXIT(); // ************************ #if __GNUC__ OS_RESTORE_ISR(); #endif }